/* ============================================================
   СӨЗДАР — app.css
   Заманауи стиль · Көк тема · Күн/Түн режимі
   ============================================================ */

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

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Brand */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  /* Light palette */
  --bg:          #f8fafc;
  --bg-card:     #ffffff;
  --bg-subtle:   #f1f5f9;
  --bg-hover:    #e8f0fe;
  --border:      #e2e8f0;
  --border-soft: #f1f5f9;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;
  --accent:      var(--blue-600);
  --accent-hov:  var(--blue-700);
  --accent-soft: var(--blue-50);
  --accent-border: var(--blue-200);

  /* Danger / success */
  --red:         #ef4444;
  --red-bg:      #fef2f2;
  --green:       #22c55e;
  --green-bg:    #f0fdf4;
  --orange:      #f97316;
  --orange-bg:   #fff7ed;
  --yellow-bg:   #fefce8;

  /* UI */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --header-h:    60px;
  --sidebar-w:   240px;
  --content-max: 780px;
  --page-max:    1200px;
  --font:        'Inter', system-ui, sans-serif;
  --font-display:'Unbounded', sans-serif;
  --transition:  .18s ease;
}

[data-theme="dark"] {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-subtle:   #1c2330;
  --bg-hover:    #1e2d42;
  --border:      #30363d;
  --border-soft: #21262d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-faint:  #484f58;
  --accent:      var(--blue-400);
  --accent-hov:  #93c5fd;
  --accent-soft: rgba(59,130,246,.12);
  --accent-border: rgba(59,130,246,.3);
  --red-bg:      rgba(239,68,68,.12);
  --green-bg:    rgba(34,197,94,.12);
  --orange-bg:   rgba(249,115,22,.12);
  --yellow-bg:   rgba(234,179,8,.12);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.3);
  --shadow:      0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.6);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hov); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }

p { line-height: 1.7; }
code { font-family: 'Fira Code', monospace; font-size: .85em;
       background: var(--bg-subtle); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--bg-subtle); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

.text-muted { color: var(--text-muted); font-size: .875rem; }
.required { color: var(--red); margin-left: 2px; }

/* ── Layout ──────────────────────────────────────────────── */
.page-wrapper { max-width: var(--page-max); margin: 0 auto;
                padding: calc(var(--header-h) + 24px) 16px 48px; }
.main-content { min-height: 60vh; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  flex-shrink: 0;
  white-space: nowrap;
}
.site-logo:hover { color: var(--accent); }

.main-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: .825rem; font-weight: 500;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link--active {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-search {
  flex: 1; max-width: 300px;
  display: flex; align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
  gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-input {
  flex: 1; border: none; background: none;
  font-size: .825rem; color: var(--text);
  outline: none; padding: 6px 0;
  min-width: 0;
}
.search-input::placeholder { color: var(--text-faint); }
.search-btn {
  background: none; border: none;
  color: var(--text-muted); padding: 2px;
  display: flex; align-items: center;
}
.search-btn:hover { color: var(--accent); }

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

/* Theme toggle button */
.theme-toggle {
  background: none; border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.theme-toggle:hover { background: var(--bg-subtle); color: var(--accent); }
.theme-toggle svg { pointer-events: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Notification bell */
.notif-bell {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.notif-bell:hover { background: var(--bg-subtle); color: var(--accent); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--red); color: #fff;
  font-size: .6rem; font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-card);
}

/* User menu */
.user-menu { position: relative; }
.user-menu-toggle {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--border);
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  color: var(--text);
  font-size: .825rem; font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
}
.user-menu-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.user-avatar { border-radius: 50%; object-fit: cover; width: 24px; height: 24px; }
.chevron { color: var(--text-muted); transition: transform var(--transition); }
.user-menu-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 200;
  display: none;
}
.user-dropdown.is-open { display: block; animation: dropIn .15s ease; }

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

.user-dropdown li a,
.user-dropdown .dropdown-logout {
  display: block; width: 100%;
  padding: 7px 12px;
  font-size: .85rem; color: var(--text);
  border-radius: var(--radius-sm);
  background: none; border: none;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.user-dropdown li a:hover,
.user-dropdown .dropdown-logout:hover {
  background: var(--bg-hover); color: var(--accent);
}
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 8px; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.mobile-menu-toggle:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}
.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav[hidden] {
  display: none !important;
}
.mobile-nav-link {
  display: block;
  padding: 9px 12px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.mobile-nav-link:hover { background: var(--bg-hover); color: var(--accent); }
.mobile-nav-link--accent { color: var(--accent); }
.mobile-divider { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

[hidden] {
  display: none !important;
}

body.menu-open {
  overflow: hidden;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: all var(--transition);
  cursor: pointer; white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hov); border-color: var(--accent-hov); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-danger {
  background: var(--red); color: #fff;
  border-color: var(--red);
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

.btn-success {
  background: var(--green); color: #fff;
  border-color: var(--green);
}

.btn-sm  { font-size: .8rem; padding: 6px 13px; }
.btn-xs  { font-size: .75rem; padding: 4px 9px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-optional { font-weight: 400; color: var(--text-muted); font-size: .8rem; margin-left: 4px; }
.form-hint { font-size: .78rem; color: var(--text-muted); }

.form-input, .form-select, .form-textarea {
  font-family: var(--font); font-size: .9rem; color: var(--text);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }
.form-textarea { resize: vertical; line-height: 1.6; }
.form-textarea--tall { min-height: 200px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-select--xs { font-size: .8rem; padding: 5px 28px 5px 8px; }

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.form-group--inline { flex-direction: row; align-items: center; gap: 10px; }

/* Checkbox label */
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Input prefix */
.input-prefix { display: flex; align-items: stretch; }
.input-prefix__text {
  display: flex; align-items: center;
  padding: 9px 11px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .85rem; color: var(--text-muted);
  white-space: nowrap;
}
.input-prefix .form-input { border-radius: 0 var(--radius) var(--radius) 0; }

/* Password reveal */
.input-reveal { position: relative; }
.input-reveal .form-input { padding-right: 40px; }
.input-reveal__btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); padding: 4px;
  display: flex; align-items: center;
}
.input-reveal__btn:hover { color: var(--accent); }

/* Char counter */
.char-counter { font-size: .75rem; color: var(--text-faint); text-align: right; }

/* Form page (auth + create/edit) */
.form-page { max-width: 500px; margin: 0 auto; padding: 16px 0 48px; }
.form-page__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.form-page__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }
.form-page__back { font-size: .85rem; margin-bottom: 20px; }

/* Auth */
.auth-wrap { max-width: 420px; margin: 0 auto; padding: 24px 0 48px; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.auth-card__head {
  background: var(--accent);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  padding: 28px 32px 24px;
  text-align: center;
}
.auth-card__title { font-size: 1.35rem; font-weight: 700; color: #fff; }
.auth-card__sub { font-size: .85rem; color: rgba(255,255,255,.75); margin-top: 4px; }
.auth-form { padding: 28px 32px; }
.auth-card__back { padding: 0 32px 20px; font-size: .85rem; }
.auth-card__terms { font-size: .78rem; color: var(--text-muted); padding: 0 32px 24px; }
.forgot-link { font-size: .8rem; color: var(--text-muted); }
.forgot-link:hover { color: var(--accent); }
.pw-hint, .new-pw-hint, .password-hint { font-size: .78rem; color: var(--text-muted); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase;
  background: var(--bg-subtle); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--active   { background: var(--green-bg); color: #15803d; border-color: #bbf7d0; }
.badge--banned   { background: var(--red-bg);   color: #b91c1c; border-color: #fecaca; }
.badge--inactive { background: var(--orange-bg); color: #c2410c; border-color: #fed7aa; }
.badge--deleted  { background: var(--red-bg);   color: #9f1239; border-color: #fecdd3; }
.badge--closed   { background: var(--yellow-bg); color: #a16207; border-color: #fef08a; }
.badge--open     { background: var(--green-bg); color: #15803d; border-color: #bbf7d0; }
.badge--pending  { background: var(--orange-bg); color: #c2410c; border-color: #fed7aa; }
.badge--resolved { background: var(--green-bg); color: #15803d; border-color: #bbf7d0; }
.badge--dismissed{ background: var(--bg-subtle); color: var(--text-muted); }

/* ── Flash messages ──────────────────────────────────────── */
.flash-container { max-width: var(--page-max); margin-bottom: 16px; }
.flash-message {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem; font-weight: 500;
  margin-bottom: 8px;
  border: 1px solid transparent;
  animation: flashIn .2s ease;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flash-success { background: var(--green-bg);  border-color: #bbf7d0; color: #15803d; }
.flash-error   { background: var(--red-bg);    border-color: #fecaca; color: #b91c1c; }
.flash-info    { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.flash-warning { background: var(--orange-bg); border-color: #fed7aa; color: #c2410c; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 24px 0 8px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-dots { color: var(--text-faint); font-size: .8rem; padding: 0 4px; }
.pagination-top, .pagination-bottom { margin: 8px 0; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 2rem; margin-bottom: 12px; opacity: .5; }
.empty-state__hint { font-size: .875rem; margin-top: 8px; color: var(--text-faint); }
.section-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: .9rem; }

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.notice--info { background: var(--accent-soft); border-color: var(--accent-border); color: var(--text); }

/* ── Meta pill ───────────────────────────────────────────── */
.meta-pill {
  font-size: .75rem; color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

/* ── Home layout ─────────────────────────────────────────── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.home-main { min-width: 0; }

/* Quick links widget */
.home-quicklinks { display: flex; flex-direction: column; gap: 10px; }
.quicklink-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.quicklink-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.qc-icon { font-size: 1.3rem; margin-bottom: 6px; }
.qc-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.qc-desc  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.quicklink-card--osekti { border-left: 3px solid var(--red); }
.quicklink-card--kup    { border-left: 3px solid var(--orange); }

/* Widget */
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.widget-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.widget-empty { padding: 16px; font-size: .85rem; color: var(--text-muted); }

/* Random block */
.random-block { margin-bottom: 16px; }
.random-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition);
}
.random-card:hover { border-color: var(--accent); }
.random-card__topic { font-size: .75rem; font-weight: 600; text-transform: uppercase;
                      letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.random-card__link { font-size: .95rem; font-weight: 600; color: var(--text); line-height: 1.4;
                     display: block; margin-bottom: 8px; }
.random-card__link:hover { color: var(--accent); }
.random-card__body { font-size: .85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
.random-card__meta { font-size: .75rem; color: var(--text-faint); }
.random-card__author { color: var(--accent); font-weight: 500; }
.random-posts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

/* ── Topic list ──────────────────────────────────────────── */
.section-page__head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.section-page__title { font-size: 1.35rem; font-weight: 700; }
.section-page__count { font-size: .85rem; color: var(--text-muted); }
.section-page__desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 16px; }
.section-page__badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 10px;
  border-radius: 999px; margin-left: auto;
}
.section-page__badge--osekti { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.section-page__badge--kup    { background: var(--orange-bg); color: var(--orange); border: 1px solid #fed7aa; }

.topic-list { display: flex; flex-direction: column; gap: 2px; }
.topic-list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.topic-list__item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.topic-list__body { flex: 1; min-width: 0; }
.topic-list__cat {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px;
  padding: 1px 8px; display: inline-block; margin-bottom: 4px;
}
.topic-list__title {
  font-size: .95rem; font-weight: 600; color: var(--text);
  display: block; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topic-list__title:hover { color: var(--accent); }
.topic-list__desc { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.topic-list__meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.topic-list__author { font-size: .78rem; color: var(--accent); font-weight: 500; }
.topic-list__time { font-size: .75rem; color: var(--text-faint); white-space: nowrap; }

/* Section header */
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.section-title { font-size: 1rem; font-weight: 700; }
.section-title__icon { font-size: 1rem; }
.section-more { font-size: .8rem; margin-left: auto; }
.title-count { font-size: .8rem; color: var(--text-muted); font-weight: 400; margin-left: 4px; }

/* ── Topic page ──────────────────────────────────────────── */
.topic-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
.topic-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.breadcrumb { font-size: .8rem; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.breadcrumb__sep { color: var(--text-faint); }
.topic-category-badge {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px;
  padding: 2px 10px; display: inline-block; margin-bottom: 10px;
}
.topic-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; line-height: 1.35; }
.topic-description { font-size: .9rem; color: var(--text-muted); margin-bottom: 12px; }
.topic-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topic-meta__item { font-size: .8rem; color: var(--text-muted); }
.topic-meta__author { font-weight: 600; color: var(--accent); }
.topic-meta__sep { color: var(--text-faint); }
.topic-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.topic-status-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase;
                      letter-spacing: .06em; padding: 3px 10px; border-radius: 999px;
                      background: var(--green-bg); color: #15803d; border: 1px solid #bbf7d0; }
.topic-status-badge--closed { background: var(--yellow-bg); color: #a16207; border-color: #fef08a; }
.topic-closed-notice {
  font-size: .85rem; color: var(--text-muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}

/* New post form */
.new-post-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.new-post-title { font-size: .9rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.post-login-prompt {
  font-size: .875rem; color: var(--text-muted);
  background: var(--bg-subtle); border-radius: var(--radius);
  padding: 12px 14px;
}
.post-form__textarea { min-height: 120px; }
.post-form__footer { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.post-form__actions { display: flex; gap: 8px; }

/* Post list */
.posts-section { margin-top: 4px; }
.posts-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: .9rem; }

.topic-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 8px;
  display: flex; gap: 14px;
  transition: border-color var(--transition);
}
.topic-list-item:hover { border-color: var(--border); }

/* Vote column */
.post-votes {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex-shrink: 0; min-width: 36px;
}
.vote-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 30px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn--up:hover   { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.vote-btn--down:hover { background: var(--red-bg);   border-color: var(--red);   color: var(--red);   }
.vote-num { font-size: .8rem; font-weight: 700; color: var(--text); }
.vote-score { font-size: .75rem; color: var(--text-muted); }
.vote-score-display { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.post-votes--lg .vote-btn { width: 36px; height: 30px; }
.post-votes--lg .vote-num { font-size: .9rem; }
.vote-fav-count { font-size: .8rem; font-weight: 700; color: var(--text-muted); }

/* Post body */
.tli-main { flex: 1; min-width: 0; }
.tli-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tli-author { font-size: .8rem; font-weight: 600; color: var(--accent); }
.tli-cat    { font-size: .75rem; }
.tli-title  { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.tli-title a:hover { color: var(--accent); }
.tli-count  { font-size: .75rem; color: var(--text-faint); }

.post-content {
  font-size: .9rem; line-height: 1.75; color: var(--text);
  word-break: break-word;
}
.post-content p { margin-bottom: .75em; }
.post-content p:last-child { margin-bottom: 0; }

.post-number { font-size: .7rem; color: var(--text-faint); font-weight: 600; margin-bottom: 6px; }
.post-time { font-size: .75rem; color: var(--text-faint); }
.post-edited { font-size: .75rem; color: var(--text-faint); font-style: italic; margin-top: 6px; }
.post-edited-label { margin-right: 4px; }

.post-action-btns {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; flex-wrap: wrap;
}
.action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 500; color: var(--text-muted);
  background: none; border: none; padding: 3px 0;
  transition: color var(--transition);
}
.action-btn:hover { color: var(--accent); }
.fav-btn:hover { color: var(--orange); }
.bookmark-btn:hover { color: var(--blue-500); }
.edit-btn:hover { color: var(--text); }
.delete-btn:hover { color: var(--red); }
.report-btn:hover { color: var(--red); }

.post-author { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-author__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-author__name { font-size: .85rem; font-weight: 600; color: var(--text); }
.post-author__name:hover { color: var(--accent); }
.post-in-topic-link { font-size: .8rem; color: var(--text-muted); display: block; margin-top: 4px; }

.score { font-size: .78rem; font-weight: 600; color: var(--text-muted); }

/* Post permalink */
.post-permalink-layout {
  display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start;
}
.post-permalink-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 16px;
}
.post-back-nav { font-size: .85rem; margin-bottom: 14px; }
.post-topic-ref { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }
.post-permalink-author { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ppa-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ppa-link { font-weight: 700; color: var(--text); font-size: .9rem; }
.ppa-link:hover { color: var(--accent); }
.ppa-username { font-size: .78rem; color: var(--text-muted); }
.ppa-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.post-permalink-body { font-size: .95rem; line-height: 1.75; word-break: break-word; }
.post-permalink-meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.post-permalink-actions { margin-top: 14px; }
.post-secondary-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.post-hidden-notice { font-size: .85rem; color: var(--text-muted); font-style: italic; margin: 8px 0; }

/* Post list (profile) */
.post-list { display: flex; flex-direction: column; gap: 8px; }
.post-list__item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.post-list__topic { font-size: .75rem; color: var(--accent); margin-bottom: 4px; }
.post-list__body { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.4; }
.post-list__excerpt { font-size: .85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.post-list__meta { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-faint); flex-wrap: wrap; }
.post-list__author { font-size: .8rem; color: var(--accent); font-weight: 500; }
.post-list__score { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.post-list__date { font-size: .75rem; color: var(--text-faint); }
.post-list--mine .post-list__item:hover { border-color: var(--accent); }

/* Latest post item (sidebar) */
.latest-posts-list { padding: 4px 0; }
.latest-post-item { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.latest-post-item:last-child { border-bottom: none; }
.lp-topic { font-size: .7rem; color: var(--accent); font-weight: 600; margin-bottom: 3px; display: block; }
.lp-excerpt { font-size: .82rem; color: var(--text); line-height: 1.4; display: block; }
.lp-excerpt:hover { color: var(--accent); }
.lp-meta { font-size: .72rem; color: var(--text-faint); margin-top: 4px; }
.lp-author { color: var(--accent); font-weight: 500; }
.lp-time { margin-left: 4px; }
.latest-topics-section { margin-bottom: 8px; }

/* ── Search page ─────────────────────────────────────────── */
.search-layout { max-width: var(--content-max); margin: 0 auto; }
.search-header { margin-bottom: 20px; }
.search-header__title { font-size: 1.25rem; font-weight: 700; }
.search-count { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.search-form-full { margin-bottom: 20px; }
.search-form-full__row { display: flex; gap: 8px; }
.search-form-full__input { flex: 1; }
.search-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-filters__select { max-width: 180px; }
.search-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.search-tabs .btn { border-radius: 999px; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-empty { text-align: center; padding: 40px 16px; color: var(--text-muted); }

/* ── Osekti / Kup ────────────────────────────────────────── */
.osekti-list { display: flex; flex-direction: column; gap: 8px; }
.osekti-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; gap: 14px; align-items: flex-start;
}
.osekti-item__rank { font-size: 1.1rem; font-weight: 800; color: var(--text-faint);
                     min-width: 28px; text-align: center; padding-top: 2px; }
.osekti-item__body { flex: 1; min-width: 0; }
.osekti-item__title { font-size: .95rem; font-weight: 700; display: block; margin-bottom: 4px; line-height: 1.4; }
.osekti-item__title:hover { color: var(--accent); }
.osekti-item__meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-muted); flex-wrap: wrap; }
.osekti-item__cat { color: var(--accent); font-weight: 600; }
.osekti-item__author { font-weight: 500; }
.osekti-item__last { color: var(--text-faint); }
.osekti-item__heat { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
                     background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; margin-left: auto; }
.osekti-item__bar { margin-top: 8px; height: 4px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.osekti-bar__fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); border-radius: 999px; }

.kup-list { display: flex; flex-direction: column; gap: 8px; }
.kup-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
}
.kup-item__rank-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 40px; }
.kup-item__rank  { font-size: 1.2rem; font-weight: 800; color: var(--text-faint); }
.kup-item__votes { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kup-item__score { font-size: .85rem; font-weight: 800; color: var(--orange); }
.kup-item__body  { flex: 1; min-width: 0; }
.kup-item__topic { font-size: .75rem; color: var(--accent); font-weight: 600; display: block; margin-bottom: 3px; }
.kup-item__excerpt { font-size: .9rem; color: var(--text); font-weight: 500; display: block; line-height: 1.4; }
.kup-item__excerpt:hover { color: var(--accent); }
.kup-item__meta   { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.kup-item__avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.kup-item__author { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.kup-item__favs   { font-size: .75rem; color: var(--text-faint); }
.kup-item__sep    { color: var(--text-faint); font-size: .75rem; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start;
}
.profile-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }
.profile-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; text-align: center;
}
.profile-card__avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
                         margin: 24px auto 12px; border: 3px solid var(--border); }
.profile-card__name     { font-size: 1rem; font-weight: 700; }
.profile-card__username { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.profile-card__bio      { font-size: .85rem; color: var(--text-muted); margin: 10px 16px 0; line-height: 1.5; }
.profile-card__stats {
  display: flex; justify-content: center; gap: 0;
  border-top: 1px solid var(--border); margin-top: 16px;
}
.stat-item { flex: 1; padding: 12px 8px; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-value { font-size: 1rem; font-weight: 800; color: var(--text); display: block; }
.stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.profile-card__meta { padding: 12px 16px; border-top: 1px solid var(--border); }
.info-list { font-size: .83rem; }
.info-list__row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border-soft); }
.info-list__row:last-child { border-bottom: none; }
.ptr-label { color: var(--text-muted); min-width: 70px; flex-shrink: 0; }
.ptr-link { color: var(--accent); }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.settings-nav {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  position: sticky; top: calc(var(--header-h) + 16px);
}
.settings-nav__link {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition), color var(--transition);
}
.settings-nav__link:last-child { border-bottom: none; }
.settings-nav__link:hover { background: var(--bg-hover); color: var(--accent); }
.settings-nav__link--active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-main { min-width: 0; }
.settings-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
}
.settings-section__title { font-size: 1rem; font-weight: 700; margin-bottom: 20px;
                            padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.settings-form {}
.settings-extra { margin-top: 8px; }
.site-email-hint, .bio-hint, .avatar-hint, .username-hint, .cat-name-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.new-pw-hint { font-size: .78rem; color: var(--text-muted); }

/* Avatar upload */
.form-group--avatar {}
.avatar-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar-upload__preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
                           border: 2px solid var(--border); }
.avatar-upload__controls { display: flex; flex-direction: column; gap: 6px; }
.avatar-upload__input { font-size: .82rem; }

/* Drafts */
.draft-list { display: flex; flex-direction: column; gap: 8px; }
.draft-list__item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 14px;
}
.draft-list__body { flex: 1; min-width: 0; }
.draft-list__title { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.draft-list__topic { font-size: .8rem; color: var(--accent); margin-bottom: 6px; }
.draft-list__topic--none { color: var(--text-muted); }
.draft-list__date { font-size: .75rem; color: var(--text-faint); }
.draft-list__actions { display: flex; gap: 6px; flex-shrink: 0; }
.draft-list__delete-form { display: inline; }
.draft-btn { color: var(--text-muted); background: none; border: none; font-size: .8rem;
             padding: 2px; transition: color var(--transition); }
.draft-btn:hover { color: var(--red); }

/* Notifications */
.notif-page__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.notif-page__title { font-size: 1.3rem; font-weight: 700; }
.notif-page__count { font-size: .85rem; color: var(--text-muted); }
.notif-list { display: flex; flex-direction: column; gap: 2px; }
.notif-item__body {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.notif-item__body:hover { border-color: var(--accent); }
.notif-item__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.notif-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 6px;
}
.notif-item__message { font-size: .9rem; color: var(--text); flex: 1; line-height: 1.5; }
.notif-item__actor { font-weight: 600; color: var(--accent); }
.notif-item__meta { font-size: .75rem; color: var(--text-faint); margin-top: 4px; }
.notif-item__time { }
.notif-item__sep  { margin: 0 4px; }
.notif-unread { background: var(--accent-soft); border-color: var(--accent-border) !important; }

/* Favorites / Bookmarks */
.saqtalgandary .post-list__item:hover { border-color: var(--accent); }

/* ── Static pages ────────────────────────────────────────── */
.static-page { max-width: 720px; margin: 0 auto; }
.static-page__head { margin-bottom: 28px; }
.static-page__title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.static-page__lead  { font-size: 1rem; color: var(--text-muted); }
.static-page__body { font-size: .95rem; line-height: 1.8; }
.static-page__body--narrow { max-width: 560px; }
.rules-section { margin-bottom: 28px; }
.rules-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.rules-section ol { list-style: decimal; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rules-section li { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }
.rules-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
                font-size: .85rem; color: var(--text-muted); }
.about-section { margin-bottom: 28px; }
.about-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.about-section p  { font-size: .9rem; color: var(--text-muted); line-height: 1.7; }
.about-cta { margin-top: 8px; }
.contact-form { max-width: 560px; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-layout {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px; align-items: start;
}
.admin-nav {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: sticky; top: calc(var(--header-h) + 16px);
}
.admin-nav__link {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition), color var(--transition);
}
.admin-nav__link:last-child { border-bottom: none; }
.admin-nav__link:hover { background: var(--bg-hover); color: var(--accent); }
.admin-nav__link--active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.admin-nav__link--back { color: var(--text-muted); font-size: .82rem; }
.admin-nav__divider { height: 1px; background: var(--border); }

.admin-main { min-width: 0; }
.admin-page-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px;
                    display: flex; align-items: baseline; gap: 10px; }
.admin-page-title__count { font-size: .85rem; color: var(--text-muted); font-weight: 400; }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-align: center;
}
.stat-card--alert { border-color: var(--red); background: var(--red-bg); }
.stat-card__value { font-size: 1.6rem; font-weight: 800; color: var(--accent); display: block; }
.stat-card--alert .stat-card__value { color: var(--red); }
.stat-card__label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase;
                    letter-spacing: .05em; margin-top: 4px; }

.admin-section { margin-bottom: 28px; }
.admin-section__title { font-size: .85rem; font-weight: 700; text-transform: uppercase;
                         letter-spacing: .07em; color: var(--text-muted);
                         margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.admin-section__more { font-size: .82rem; }

.admin-quicklinks { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; flex: 1; min-width: 140px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.admin-card--form { flex: none; }
.admin-card__title { font-size: .85rem; font-weight: 700; margin-bottom: 4px; }

.admin-search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search-form__input { flex: 1; }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: .85rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-table thead th {
  background: var(--bg-subtle); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-subtle); }
.admin-table__row--deleted { opacity: .5; }
.admin-table--logs .admin-table tbody td { font-size: .8rem; }
.admin-table__actions { display: flex; gap: 6px; align-items: center; }
.log-col-time, .log-col-actor, .log-col-action, .log-col-target, .log-col-data, .log-col-ip { white-space: nowrap; }
.log-action { font-size: .72rem; font-weight: 700; letter-spacing: .04em;
              padding: 2px 8px; border-radius: 4px; background: var(--bg-subtle);
              color: var(--text-muted); border: 1px solid var(--border); }
.log-data { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-target-id { color: var(--text-faint); }

.admin-split { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.admin-split__main {}
.admin-split__aside {}

/* ── Sidebar (topic/post) ────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.sidebar--left { grid-column: 1; }

/* ── Modal ───────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal__box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: none; } }
.modal__inner { padding: 24px; }
.modal__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.modal__subtitle { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; }
.modal__textarea { margin-bottom: 14px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; }
.ban-modal-title, .report-modal-title, .rm-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.ban-modal-username, .ban-reason, .ban-expires { margin-bottom: 12px; }
.ban-cancel, .report-cancel { }
.report-reason, .report-desc { margin-bottom: 10px; }

/* ── Inline form ─────────────────────────────────────────── */
.inline-form { display: inline; }
.inline-form button { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }

/* ── Error page ──────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-page__body { text-align: center; padding: 40px 24px; }
.error-page__code { font-family: var(--font-display); font-size: 5rem; font-weight: 700;
                    color: var(--accent); display: block; line-height: 1; margin-bottom: 16px; opacity: .3; }
.error-page__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; }
.error-page__desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 24px; }
.error-page__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer-inner {
  max-width: var(--page-max); margin: 0 auto;
  padding: 28px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
}
.footer-logo { font-family: var(--font-display); font-size: .9rem; font-weight: 700; color: var(--text); }
.footer-logo:hover { color: var(--accent); }
.footer-tagline { font-size: .75rem; color: var(--text-faint); margin-top: 3px; }
.footer-nav { display: flex; align-items: center; gap: 20px; }
.footer-nav a { font-size: .82rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }
.footer-copy { font-size: .75rem; color: var(--text-faint); text-align: right; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .home-layout, .topic-layout, .post-permalink-layout {
    grid-template-columns: 1fr;
  }
  .sidebar, .home-quicklinks { position: static; }
  .random-posts-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .main-nav { display: none; }
  .header-search { display: none; }
  .mobile-menu-toggle { display: flex; }
  .user-name { display: none; }

  .mobile-nav.is-open {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 99;
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .profile-layout, .settings-layout, .admin-layout, .admin-split {
    grid-template-columns: 1fr;
  }
  .admin-nav, .settings-nav { position: static; }
  .profile-sidebar { position: static; }
  .profile-card { text-align: left; }
  .profile-card__avatar { margin: 16px 16px 0; }
  .profile-card__stats { justify-content: flex-start; }

  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: 14px; }
  .footer-copy { text-align: center; }
  .footer-nav { justify-content: center; }

  .auth-form, .auth-card__back, .auth-card__terms { padding-left: 20px; padding-right: 20px; }
  .auth-card__head { padding: 20px 20px 18px; }

  .form-page__card { padding: 20px; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .page-wrapper { padding-top: calc(var(--header-h) + 16px); padding-left: 12px; padding-right: 12px; }
  .topic-list__item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topic-list__meta { justify-content: flex-start; }
  .kup-item { flex-wrap: wrap; }
  .admin-stats { grid-template-columns: 1fr; }
}
