/* === Site Colour Palette === */
:root {
  /* Neutrals */
  --c-black:      #0d0d0d;
  --c-near-black: #111111;
  --c-grey-dark:  #374151;
  --c-grey-mid:   #6b7280;
  --c-grey-light: #d1d5db;
  --c-grey-pale:  #f3f4f6;
  --c-white:      #ffffff;
  --c-off-white:  #fafafa;

  /* Accent */
  --c-brick:  #670f0f;
  --c-forest: #0c3b0c;
  --c-blue:   #2e2f87;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #fafafa;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #3b82f6; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* === Header === */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-nav { display: flex; gap: 1rem; align-items: center; }
.nav-link {
  font-size: 0.875rem;
  color: #4b5563;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-link:hover { background: #f3f4f6; text-decoration: none; color: #1a1a1a; }
.nav-cta {
  background: #1a1a1a;
  color: #fff !important;
  padding: 0.35rem 0.9rem;
}
.nav-cta:hover { background: #333; }
.nav-logout { color: #ef4444 !important; }

/* === Main === */
.site-main { flex: 1; }

/* === Footer === */
.site-footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-primary   { background: #1a1a1a; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #1a1a1a; }
.btn-danger    { background: #fef2f2; color: #ef4444; border: 1px solid #fca5a5; }
.btn-small     { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-full      { width: 100%; }
.btn-self-end  { align-self: flex-end; }

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #86efac; }
.alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #93c5fd; }

/* === Forms === */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
label { font-size: 0.875rem; font-weight: 600; color: #374151; }
.label-hint { font-weight: 400; color: #9ca3af; font-size: 0.8rem; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  padding: 0.55rem 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: #3b82f6; }
textarea { resize: vertical; min-height: 100px; }
input::placeholder, textarea::placeholder { color: #b0b7c3; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin-bottom: 0.5rem; cursor: pointer; }
.form-group--inline { flex-direction: row; gap: 1.5rem; align-items: center; }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-grey   { background: #f3f4f6; color: #6b7280; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }

/* === Home === */
.home-wrap { max-width: 680px; margin: 0 auto; padding: 4rem 1.5rem 3rem; }
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero-title { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 0.75rem; }
.hero-sub { color: #6b7280; font-size: 1rem; margin-bottom: 2rem; }
.hero-tagline {
  font-size: 1.1rem;
  color: #374151;
  line-height: 1.65;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero-explainer {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.hero-explainer p {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.7;
}
.search-box { display: flex; gap: 0.5rem; }
.search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.95rem;
}
.search-btn {
  padding: 0 1.1rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.results { margin-top: 2rem; }
.results-count { color: #6b7280; font-size: 0.875rem; margin-bottom: 1rem; }
.results-empty { color: #6b7280; text-align: center; margin-top: 2rem; }
.results-grid { display: flex; flex-direction: column; gap: 0.65rem; }
.result-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.result-card:hover { border-color: #3b82f6; box-shadow: 0 2px 8px rgba(59,130,246,0.1); text-decoration: none; }
/* result-avatar is now rendered by the avatar partial with account-avatar--sm */
.result-info { display: flex; flex-direction: column; flex: 1; }
.result-username { font-weight: 700; font-size: 0.95rem; }
.result-pagename { font-size: 0.8rem; color: #6b7280; }
.result-bio { font-size: 0.8rem; color: #9ca3af; font-style: italic; margin-top: 0.15rem; }
.result-lock { display: inline-flex; align-items: center; color: #9ca3af; }
.home-cta { text-align: center; color: #6b7280; font-size: 0.95rem; margin-top: 2rem; }

/* === Auth === */
.auth-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 3rem 1.5rem; }
.auth-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 2rem; width: 100%; max-width: 420px; }
.auth-card--wide { max-width: 680px; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; }
.auth-alt { margin-top: 1.25rem; text-align: center; font-size: 0.875rem; color: #6b7280; }

/* === Password Gate === */
.gate-wrap { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 2rem; }
.gate-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 380px; text-align: center; }
.gate-lock { font-size: 3rem; margin-bottom: 1rem; }
.gate-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }
.gate-form { text-align: left; }

/* === User Page === */
.userpage-wrap { max-width: 680px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.userpage-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
/* userpage-avatar is now rendered by the avatar partial with account-avatar--lg */
.userpage-name { font-size: 1.5rem; font-weight: 800; }
.userpage-handle { font-size: 0.875rem; color: #6b7280; }
.userpage-bio { font-size: 0.875rem; color: #6b7280; margin-top: 0.35rem; font-style: italic; }
.userpage-content { margin-bottom: 3rem; }

/* Page blocks */
.page-block { margin-bottom: 1.5rem; }
.page-block--h1 { font-size: 2rem; font-weight: 800; }
.page-block--h2 { font-size: 1.6rem; font-weight: 700; }
.page-block--h3 { font-size: 1.35rem; font-weight: 700; }
.page-block--h4 { font-size: 1.15rem; font-weight: 700; }
.page-block--h5 { font-size: 1rem; font-weight: 700; }
.page-block--h6 { font-size: 0.9rem; font-weight: 700; color: #6b7280; }
.page-block--text { line-height: 1.7; color: #374151; }
.page-block--image img { border-radius: 10px; width: 100%; }
.page-block--gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}
.gallery-item img { border-radius: 8px; width: 100%; height: 180px; object-fit: cover; }
.page-block--divider { border: none; border-top: 1px solid #e5e7eb; }

/* === Placeholder / dummy content === */
.userpage-content--placeholder { pointer-events: none; user-select: none; }
.placeholder-block { border-radius: 10px; margin-bottom: 1.25rem; }
.placeholder-img {
  background: linear-gradient(135deg, #e5e7eb 25%, #d1d5db 100%);
  width: 100%;
}
.placeholder-img--wide { height: 260px; }
.placeholder-img--sq   { height: 160px; }
.placeholder-img--dark {
  background: linear-gradient(135deg, #374151 25%, #1a1a1a 100%);
}
.placeholder-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.placeholder-text { padding: 0.25rem 0; }
.placeholder-line {
  height: 14px;
  background: #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.6rem;
}
.placeholder-line--90 { width: 90%; }
.placeholder-line--80 { width: 80%; }
.placeholder-line--70 { width: 70%; }
.placeholder-line--55 { width: 55%; }
.placeholder-notice {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 1.5rem;
  pointer-events: auto;
}

/* === Comments === */
.comments-section { border-top: 1px solid #e5e7eb; padding-top: 2rem; }
.comments-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.comment-toggle-btn { margin-bottom: 0.5rem; }
.comment-form { margin-bottom: 2rem; }
.spam-question input { max-width: 120px; }
.comments-closed { color: #9ca3af; font-size: 0.875rem; margin-bottom: 1.5rem; }
.comments-list { display: flex; flex-direction: column; gap: 1rem; }
.comment-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.comment-header { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; font-size: 0.875rem; }
.comment-date { font-size: 0.78rem; color: #9ca3af; }
.comment-body { font-size: 0.9rem; color: #374151; line-height: 1.6; }

/* === Account / Dashboard === */
.account-wrap { display: flex; min-height: calc(100vh - 56px); }
.account-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.account-main {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 800px;
  background: var(--c-blue);
}
.account-main h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; color: #f9fafb; }
.account-avatar {
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  object-fit: cover;
}
.account-avatar--sm  { width: 44px;  height: 44px;  font-size: 1.1rem; }
.account-avatar--md  { width: 52px;  height: 52px;  font-size: 1.25rem; }
.account-avatar--lg  { width: 80px;  height: 80px;  font-size: 2rem; }
.account-avatar--img { background: none; object-fit: cover; max-width: none; }
.avatar-upload-row { display: flex; align-items: center; gap: 1.25rem; }
.account-user { display: flex; flex-direction: column; gap: 0.2rem; }
.account-user strong { font-size: 0.9rem; }
.account-user span { font-size: 0.78rem; color: #6b7280; }
.account-nav { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.account-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  transition: background 0.12s;
}
.account-nav-link:hover { background: #f3f4f6; text-decoration: none; color: #1a1a1a; }
.account-nav-link--active { background: #f3f4f6; font-weight: 600; color: #1a1a1a; }

/* Dashboard cards */
.dashboard-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.dash-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
}
.dash-card-label { font-size: 0.78rem; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.dash-card-value { font-size: 1rem; font-weight: 600; }
.dashboard-actions { display: flex; gap: 0.75rem; }

/* Settings */
.settings-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.settings-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.settings-hint { font-size: 0.9rem; color: #374151; margin-bottom: 1rem; }
.settings-hint strong { color: #111; }

/* Comments admin */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  border-radius: 999px;
  font-size: 0.8rem;
  min-width: 24px;
  height: 24px;
  padding: 0 0.5rem;
  font-weight: 600;
  margin-left: 0.5rem;
}
.admin-comments-list { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-comment {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #fff;
}
.admin-comment--private { border-left: 3px solid #e5e7eb; }
.admin-comment--public  { border-left: 3px solid #3b82f6; }
.admin-comment-header { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.admin-comment-body { font-size: 0.9rem; margin-bottom: 0.75rem; color: #374151; }
.admin-comment-delete { display: inline-block; }
.comment-vis-badge { font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; font-weight: 600; }
.comment-vis-note { font-size: 0.75rem; color: #9ca3af; }
.empty-state { color: #9ca3af; }

/* === Editor === */
.editor-wrap { display: flex; min-height: calc(100vh - 56px); }
.editor-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.editor-main {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 760px;
  background: var(--c-blue);
}
.editor-instructions {
  font-size: 1.05rem;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.6;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}
.editor-instructions-sub {
  font-size: 0.95rem;
  font-weight: 400;
}
.editor-tools-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #9ca3af; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.block-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.block-btn-group { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.block-add-btn {
  padding: 0.3rem 0.6rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
  white-space: nowrap;
  width: fit-content;
}
.block-add-btn:hover { background: #e5e7eb; }
.editor-publish-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 12px;
}
.toggle-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.save-status { font-size: 0.8rem; color: #6b7280; min-height: 1rem; }

/* Block list */
.block-list { display: flex; flex-direction: column; gap: 0.75rem; }
.editor-hint { text-align: center; color: #9ca3af; margin-top: 4rem; }
.editor-block {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  position: relative;
  transition: border-color 0.12s;
}
.editor-block:hover { border-color: #93c5fd; }
.editor-block.dragging { opacity: 0.5; }
.editor-block.drag-over { border-color: #3b82f6; background: #eff6ff; }
.block-toolbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.block-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.05em;
  margin-right: auto;
}
.block-btn {
  padding: 0.2rem 0.5rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
}
.block-btn:hover { background: #e5e7eb; }
.block-btn--active { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.block-btn--danger { color: #ef4444; }
.block-content-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  color: #1a1a1a;
  resize: none;
  outline: none;
  min-height: 1.6rem;
  line-height: 1.5;
  overflow: hidden;
}
.block-content-input--h1 { font-size: 1.75rem; font-weight: 800; }
.block-content-input--h2 { font-size: 1.45rem; font-weight: 700; }
.block-content-input--h3 { font-size: 1.2rem; font-weight: 700; }
.block-content-input--h4 { font-size: 1.05rem; font-weight: 700; }
.block-content-input--h5 { font-size: 0.95rem; font-weight: 700; }
.block-content-input--h6 { font-size: 0.875rem; font-weight: 700; color: #6b7280; }
.block-image-preview { max-width: 100%; border-radius: 8px; }
.block-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.4rem; margin-top: 0.5rem; }
.block-gallery-img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }
.block-gallery-item { position: relative; }
.block-gallery-remove {
  position: absolute;
  top: 3px; right: 3px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.block-divider-line { border: none; border-top: 2px dashed #e5e7eb; }
.drag-handle { cursor: grab; color: #d1d5db; font-size: 1.1rem; margin-right: 0.25rem; }
.drag-handle:active { cursor: grabbing; }
.block-content-editable {
  width: 100%;
  min-height: 3rem;
  font-family: inherit;
  font-size: 1rem;
  color: #1a1a1a;
  line-height: 1.6;
  outline: none;
  padding: 0.25rem 0;
}
.block-content-editable:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.modal-inner {
  background: #fff;
  border-radius: 14px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-inner h3 { font-size: 1.1rem; font-weight: 700; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
#upload-preview img { max-width: 100%; border-radius: 8px; }

/* === Error === */
.error-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; gap: 1rem; text-align: center; }
.error-code { font-size: 5rem; font-weight: 900; color: #e5e7eb; }
.error-msg { font-size: 1.1rem; color: #6b7280; }

/* === Responsive === */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .account-wrap { flex-direction: column; }
  .account-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    flex-direction: column;
  }
  .account-nav { flex-direction: row; flex-wrap: wrap; }
  .editor-wrap { flex-direction: column; }
  .editor-sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid #e5e7eb; }
  .editor-main { padding: 1.5rem; }
  .dashboard-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.75rem; }
}

/* === Admin Panel === */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #7f1d1d;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 800; color: #7f1d1d; }
.admin-badge {
  background: #7f1d1d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.03em;
}
.admin-badge--sm {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  vertical-align: middle;
  margin-left: 0.25rem;
}
.admin-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111;
}
.admin-hint { color: #9ca3af; font-size: 0.8rem; font-weight: 400; }
.admin-settings-form { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.admin-toggle-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* User list table */
.admin-user-list { display: flex; flex-direction: column; gap: 0; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.admin-user-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 0.75fr 1.25fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-row--head {
  background: #f9fafb;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}
.admin-user-row--frozen { background: #fef2f2; }
.admin-user-info { display: flex; align-items: center; gap: 0.6rem; }
.admin-user-info strong { display: block; font-size: 0.875rem; }
.admin-user-info small { display: block; color: #9ca3af; font-size: 0.75rem; }
.admin-page-link { color: #3b82f6; font-size: 0.825rem; }
.admin-vis-tag { font-size: 0.72rem; color: #9ca3af; display: block; margin-top: 0.15rem; }
.admin-status { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 99px; }
.admin-status--active { background: #dcfce7; color: #166534; }
.admin-status--frozen { background: #fee2e2; color: #991b1b; }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Extra small buttons for admin table */
.btn-xs {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.4;
}
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-warning:hover { background: #fde68a; }
.btn-success { background: #dcfce7; color: #166534; }
.btn-success:hover { background: #bbf7d0; }
.btn-danger  { background: #fee2e2; color: #991b1b; }
.btn-danger:hover  { background: #fecaca; }

/* Pagination */
.admin-pagination { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1rem; }
.admin-page-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 0.825rem;
  color: #374151;
  text-decoration: none;
}
.admin-page-btn:hover { background: #f3f4f6; text-decoration: none; }
.admin-page-btn--active { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
