/* ════════════════════════════════════════════════════════
   Synology Fórum – Hlavní CSS
   Tmavé téma, modro-azurové akcenty, Plus Jakarta Sans
   ════════════════════════════════════════════════════════ */

:root {
  --bg-0:      #383d47;
  --bg-1:      #3d4453;
  --bg-2:      #424b5d;
  --bg-3:      #47536b;
  --bg-card:   #404652;
  --bg-hover:  #4b576b;

  --border:    #4b5979;
  --border-2:  #4f5f7f;

  --text-1:    #f0f4ff;
  --text-2:    #a9b5c6;
  --text-3:    #838fa2;

  --blue:      #2563eb;
  --blue-l:    #3b82f6;
  --blue-d:    #1d4ed8;
  --cyan:      #0ea5e9;
  --cyan-d:    #0284c7;

  --green:     #10b981;
  --yellow:    #f59e0b;
  --red:       #ef4444;
  --purple:    #8b5cf6;
  --orange:    #f97316;

  --rank-novacek: #64748b;
  --rank-clen:    #3b82f6;
  --rank-veteran: #8b5cf6;
  --rank-expert:  #f59e0b;

  --radius-s:  6px;
  --radius-m:  10px;
  --radius-l:  16px;
  --radius-xl: 24px;

  --shadow-s:  0 1px 3px rgba(0,0,0,.4);
  --shadow-m:  0 4px 16px rgba(0,0,0,.5);
  --shadow-l:  0 8px 32px rgba(0,0,0,.6);
  --shadow-glow: 0 0 24px rgba(37,99,235,.25);

  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 60px;
  --max-w: 1200px;
}

/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-l); text-decoration: none; }
a:hover { color: var(--cyan); }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: var(--radius-s);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue-l);
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* ═══ NAVBAR ════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(7, 13, 26, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; color: var(--text-1);
}
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.logo-accent { color: var(--cyan); }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-s);
  transition: all .15s;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-1);
  background: var(--bg-3);
}
.nav-search {
  flex: 1; max-width: 360px;
  position: relative;
}
.nav-search input {
  width: 100%; padding: 8px 36px 8px 14px;
  font-size: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all .2s;
}
.nav-search input:focus { border-color: var(--blue-l); background: var(--bg-3); }
.search-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-m); overflow: hidden;
  box-shadow: var(--shadow-l);
  display: none; z-index: 200;
}
.search-results.open { display: block; }
.search-result-item {
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-title { font-size: 13px; font-weight: 600; color: var(--text-1); }
.search-result-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-burger {
  display: none; flex-direction: column; gap: 4px;
  padding: 8px; border-radius: var(--radius-s);
}
.nav-burger span {
  width: 20px; height: 2px;
  background: var(--text-2);
  border-radius: 1px;
  display: block;
  transition: all .2s;
}

/* ─── Notifikace badge ───────────────────────────────── */
.notif-btn {
  position: relative;
  padding: 8px;
  border-radius: var(--radius-s);
  color: var(--text-2);
  background: transparent;
  transition: all .15s;
}
.notif-btn:hover { background: var(--bg-3); color: var(--text-1); }
.notif-btn svg { width: 20px; height: 20px; display: block; }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 9px; font-weight: 700;
  color: white; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-0);
}

/* ═══ TLAČÍTKA ══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--radius-s);
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover { background: var(--blue-d); color: white; transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-secondary {
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-ghost { background: transparent; color: var(--text-2); padding: 6px 12px; }
.btn-ghost:hover { color: var(--text-1); background: var(--bg-3); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ═══ KARTY ═════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 24px; }

/* ═══ HERO SEKCE ════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, #0a1628 0%, #0d1e3d 40%, #0a1e3a 70%, #061423 100%);
  padding: 72px 24px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(37,99,235,.15) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(14,165,233,.1) 0%, transparent 50%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37,99,235,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.06) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  position: relative; z-index: 1;
}
.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #fff;
}
.hero-title span { color: var(--cyan); }
.hero-subtitle { font-size: 16px; color: #94a3b8; margin-top: 12px; max-width: 480px; }
.hero-search {
  margin-top: 28px;
  display: flex; gap: 0;
  max-width: 520px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.hero-search input {
  flex: 1; padding: 14px 18px;
  background: transparent;
  border: none;
  font-size: 15px;
  color: white;
}
.hero-search input::placeholder { color: rgba(255,255,255,.4); }
.hero-search input:focus { box-shadow: none; }
.hero-search button {
  padding: 14px 20px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}
.hero-search button:hover { background: var(--blue-d); }
.hero-nas {
  width: 260px; height: 260px;
  position: relative;
}
.hero-nas-img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(37,99,235,.4));
  animation: float 4s ease-in-out infinite;
}
.hero-nas-glow {
  position: absolute; inset: 20px;
  background: radial-gradient(circle, rgba(37,99,235,.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse-glow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* ─── Stats strip ───────────────────────────────────── */
.stats-strip {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}
.stats-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; gap: 32px; align-items: center;
}
.stat-item { display: flex; align-items: center; gap: 8px; }
.stat-num { font-size: 18px; font-weight: 700; color: var(--blue-l); }
.stat-label { font-size: 13px; color: var(--text-3); }

/* ═══ KATEGORIE GRID ════════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.category-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.category-card:hover {
  border-color: var(--border-2);
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-m);
  color: var(--text-1);
}
.cat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.cat-info { flex: 1; min-width: 0; }
.cat-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.cat-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-counts { font-size: 11px; color: var(--text-3); margin-top: 6px; display: flex; gap: 10px; }

/* ═══ THREAD LIST ═══════════════════════════════════════ */
.threads-list { display: flex; flex-direction: column; gap: 2px; }
.thread-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: all .15s;
}
.thread-item:hover { background: var(--bg-hover); border-color: var(--border-2); }
.thread-item.pinned { border-left: 3px solid var(--blue-l); }
.thread-item.solved .thread-title { color: var(--green); }

.thread-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--text-2);
}
.thread-avatar img { width: 100%; height: 100%; object-fit: cover; }

.thread-body { flex: 1; min-width: 0; }
.thread-title {
  font-size: 15px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread-meta {
  font-size: 12px; color: var(--text-3); margin-top: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.thread-meta a { color: var(--text-3); }
.thread-meta a:hover { color: var(--blue-l); }

.thread-stats {
  display: flex; gap: 20px;
  flex-shrink: 0; text-align: center;
}
.thread-stat { display: flex; flex-direction: column; align-items: center; }
.thread-stat-num { font-size: 16px; font-weight: 700; color: var(--text-1); }
.thread-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }

/* ─── Typ badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 11px; font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase; letter-spacing: .4px;
}
.badge-discussion { background: rgba(59,130,246,.15); color: var(--blue-l); }
.badge-question   { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-tutorial   { background: rgba(16,185,129,.15); color: var(--green); }
.badge-announcement { background: rgba(239,68,68,.15); color: var(--red); }
.badge-solved     { background: rgba(16,185,129,.15); color: var(--green); }
.badge-pinned     { background: rgba(14,165,233,.15); color: var(--cyan); }
.badge-moderator  { background: rgba(239,68,68,.15); color: var(--red); }
.badge-admin      { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-expert     { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-veteran    { background: rgba(139,92,246,.15); color: var(--purple); }
.badge-clen       { background: rgba(59,130,246,.15); color: var(--blue-l); }
.badge-novacek    { background: rgba(100,116,139,.15); color: var(--text-3); }

/* ═══ STRÁNKA TÉMATU ════════════════════════════════════ */
.thread-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
.thread-header {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  margin-bottom: 16px;
}
.thread-header h1 {
  font-size: 24px; font-weight: 700; color: var(--text-1);
  line-height: 1.3; margin: 12px 0;
}
.thread-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thread-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Post ──────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.post-card.solution { border-color: var(--green); }
.post-card.solution .post-header { background: rgba(16,185,129,.08); }
.solution-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: rgba(16,185,129,.12);
  border-bottom: 1px solid rgba(16,185,129,.2);
  font-size: 13px; font-weight: 600; color: var(--green);
}
.post-header {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.post-author {
  display: flex; align-items: flex-start; gap: 12px; flex: 1;
}
.post-author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-3); flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center;
  justify-content: center; font-size: 18px; font-weight: 700;
}
.post-author-info { display: flex; flex-direction: column; gap: 3px; }
.post-author-name {
  font-weight: 700; font-size: 15px; color: var(--text-1);
  cursor: pointer;
}
.post-author-name:hover { color: var(--blue-l); }
.post-author-meta { display: flex; align-items: center; gap: 8px; }
.post-author-stats { font-size: 12px; color: var(--text-3); }
.post-body { padding: 20px; }
.post-content { font-size: 15px; line-height: 1.75; color: var(--text-1); }
.post-content p  { margin-bottom: 12px; }
.post-content code {
  background: var(--bg-2); padding: 2px 6px;
  border-radius: 4px; font-family: var(--font-mono); font-size: .9em;
  color: var(--cyan);
}
.post-content pre {
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 16px;
  overflow-x: auto; margin: 12px 0;
}
.post-content pre code { background: none; padding: 0; color: var(--text-1); }
.post-content blockquote {
  border-left: 3px solid var(--blue-l);
  padding: 4px 16px; margin: 12px 0;
  color: var(--text-2); font-style: italic;
}
.post-content a { color: var(--blue-l); }
.post-content a:hover { text-decoration: underline; }
.post-content h2,h3,h4 { margin: 16px 0 8px; font-weight: 700; color: var(--text-1); }
.post-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.post-actions { display: flex; align-items: center; gap: 4px; }
.post-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text-3);
  border-radius: var(--radius-s);
  transition: all .15s;
}
.post-action-btn:hover { background: var(--bg-3); color: var(--text-1); }
.post-action-btn.liked { color: var(--blue-l); }
.post-action-btn.liked svg { fill: var(--blue-l); }
.post-action-btn svg { width: 16px; height: 16px; }
.post-time { font-size: 12px; color: var(--text-3); }

/* ─── Reply box ─────────────────────────────────────── */
.reply-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 24px;
  margin-top: 16px;
}
.reply-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.editor-toolbar {
  display: flex; gap: 2px;
  padding: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-s) var(--radius-s) 0 0;
  flex-wrap: wrap;
}
.editor-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--text-2);
  font-size: 13px; font-weight: 700;
  transition: all .1s;
}
.editor-btn:hover { background: var(--bg-3); color: var(--text-1); }
.editor-textarea {
  width: 100%; min-height: 140px; padding: 14px;
  resize: vertical; font-size: 14px; line-height: 1.6;
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  font-family: var(--font-body);
}

/* ═══ FORMULÁŘE ═════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.form-label span { color: var(--red); }
.form-input {
  width: 100%; padding: 10px 14px;
  font-size: 14px;
}
.form-textarea {
  width: 100%; padding: 12px 14px;
  font-size: 14px; resize: vertical; min-height: 120px;
}
.form-select { width: 100%; padding: 10px 14px; font-size: 14px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══ AUTH STRÁNKY ══════════════════════════════════════ */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(37,99,235,.12) 0%, transparent 60%);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-l);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 24px; font-weight: 800; margin-top: 12px; }
.auth-logo p  { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  font-size: 12px; color: var(--text-3);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-2); }

/* ═══ PROFIL ════════════════════════════════════════════ */
.profile-page {
  max-width: var(--max-w); margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 28px;
  text-align: center;
}
.profile-avatar-wrap { position: relative; display: inline-block; }
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800; color: white;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-username { font-size: 20px; font-weight: 700; }
.profile-rank { margin-top: 6px; }
.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-top: 20px;
}
.profile-stat {
  background: var(--bg-2);
  border-radius: var(--radius-s);
  padding: 12px;
  text-align: center;
}
.profile-stat-num { font-size: 20px; font-weight: 700; color: var(--blue-l); }
.profile-stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ═══ SIDEBAR ════════════════════════════════════════════ */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.sidebar-title {
  padding: 16px 20px;
  font-size: 14px; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.sidebar-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: var(--bg-hover); }
.sidebar-item-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item-meta  { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ═══ LAYOUT HELPERS ════════════════════════════════════ */
.page { max-width: var(--max-w); margin: 0 auto; padding: 32px 24px; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 800; }
.section { margin-bottom: 40px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* ═══ TOAST ═════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  font-size: 14px;
  min-width: 280px; max-width: 400px;
  animation: slideIn .2s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue-l); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ MODAL ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-l);
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s);
  color: var(--text-3);
  font-size: 20px; line-height: 1;
  transition: all .15s;
}
.modal-close:hover { background: var(--bg-3); color: var(--text-1); }
.modal-body { padding: 28px; }

/* ═══ LOADER ═════════════════════════════════════════════ */
.page-loader {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}
.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-l);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ PAGINATION ════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 24px;
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s);
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
  transition: all .15s;
  border: 1px solid transparent;
}
.page-btn:hover { background: var(--bg-3); color: var(--text-1); }
.page-btn.active { background: var(--blue); color: white; }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ═══ EMPTY STATE ════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ═══ TAG ════════════════════════════════════════════════ */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  font-size: 12px; font-weight: 600;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all .15s;
  cursor: pointer;
}
.tag:hover { border-color: var(--blue-l); color: var(--blue-l); }

/* ═══ STAV SYSTÉMU ═══════════════════════════════════════ */
.status-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.status-item:last-child { border-bottom: none; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  animation: pulse 2s infinite;
}
.status-dot.ok { background: var(--green); }
.status-dot.warn { background: var(--yellow); }
.status-dot.error { background: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ═══ RESPONSIVITA ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .thread-page,
  .profile-page { grid-template-columns: 1fr; }
  .hero-inner   { grid-template-columns: 1fr; }
  .hero-nas     { display: none; }
  .nav-links    { display: none; }
  .nav-burger   { display: flex; }
  .nav-search   { max-width: 200px; }
  .thread-stats { display: none; }
  .form-row     { grid-template-columns: 1fr; }
  .stats-inner  { flex-wrap: wrap; gap: 16px; }
}
@media (max-width: 600px) {
  .hero         { padding: 48px 16px; }
  .page         { padding: 20px 16px; }
  .auth-card    { padding: 28px 20px; }
  .thread-item  { padding: 12px 14px; }
  .nav-search   { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   VYLEPŠENÉ MOBILNÍ STYLY
   ═══════════════════════════════════════════════════════════ */

/* Tablet a menší (≤900px) */
@media (max-width: 900px) {
  /* Hero */
  .hero { padding: 40px 20px; }
  .hero-title { font-size: 32px; line-height: 1.1; }
  .hero-subtitle { font-size: 14px; }

  /* Kategorie - 2 sloupce */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .category-card { padding: 14px; gap: 10px; }
  .cat-name { font-size: 14px; }
  .cat-desc { font-size: 12px; }

  /* Statistiky */
  .stats-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 16px;
  }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 12px; }

  /* Vlákna v seznamu */
  .thread-item { padding: 14px; }
  .thread-title-link { font-size: 15px; }
  .thread-meta { font-size: 12px; flex-wrap: wrap; gap: 6px; }

  /* Detail vlákna */
  .thread-page { gap: 16px; }
  .post-card { padding: 16px; }
  .post-content { font-size: 14px; line-height: 1.6; }
  .post-content h1 { font-size: 22px; }
  .post-content h2 { font-size: 18px; }
  .post-content h3 { font-size: 16px; }
  .post-content pre {
    font-size: 12px;
    overflow-x: auto;
    padding: 12px;
  }

  /* Navigace */
  .navbar { padding: 0 16px; }
  .nav-logo { font-size: 18px; }
  .nav-search input { font-size: 13px; }
}

/* Telefon (≤600px) */
@media (max-width: 600px) {
  /* Hero */
  .hero { padding: 32px 16px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 13px; margin-top: 8px; }
  .hero-search { margin-top: 20px; }
  .hero-search input { padding: 12px 16px; font-size: 14px; }
  .hero-search button { padding: 12px 20px; }

  /* Kategorie - 1 sloupec */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .category-card { padding: 14px; }

  /* Stránky */
  .page { padding: 16px 12px; }
  .page-title { font-size: 22px; }
  .page-header { margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

  /* Vlákna */
  .thread-item {
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .thread-stats-mini { font-size: 11px; }

  /* Detail vlákna */
  .thread-header { padding: 16px; }
  .thread-header h1 { font-size: 20px; line-height: 1.2; }
  .thread-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .thread-actions button,
  .thread-actions .btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  .post-card { padding: 12px; }
  .post-author { gap: 10px; }
  .post-avatar img,
  .post-avatar { width: 36px !important; height: 36px !important; }
  .post-author-name { font-size: 13px; }
  .post-body { padding: 12px; }
  .post-content { font-size: 13px; }
  .post-content table { font-size: 11px; }
  .post-actions { flex-wrap: wrap; gap: 6px; }
  .post-action-btn { font-size: 11px; padding: 4px 8px; }

  /* Formulář */
  .form-input, .form-textarea, .form-select {
    font-size: 16px;  /* zabraňuje zoom na iOS */
    padding: 10px 12px;
  }

  /* Auth karta */
  .auth-card {
    padding: 24px 16px;
    margin: 16px 12px;
  }
  .auth-card h1 { font-size: 22px; }

  /* Tlačítka */
  .btn { font-size: 14px; padding: 10px 16px; }
  .btn-sm { font-size: 12px; padding: 6px 10px; }

  /* Notifikace dropdown */
  .notif-dropdown,
  .user-dropdown {
    position: fixed;
    top: var(--nav-h);
    left: 8px;
    right: 8px;
    max-width: none;
    width: auto;
  }

  /* Toasts */
  .toast {
    left: 12px;
    right: 12px;
    max-width: none;
    font-size: 13px;
  }

  /* Editor toolbar - skrýt méně použité */
  .editor-toolbar { gap: 4px; padding: 6px; }
  .editor-toolbar button { padding: 4px 8px; font-size: 13px; }

  /* Breadcrumbs */
  .breadcrumbs {
    font-size: 12px;
    flex-wrap: wrap;
  }
}

/* Velmi malé telefony (≤380px) */
@media (max-width: 380px) {
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 12px; }
  .nav-logo { font-size: 16px; }
  .nav-search { display: none; }
  .stat-num { font-size: 18px; }
}

/* Touch zařízení - větší klikatelné oblasti */
@media (hover: none) and (pointer: coarse) {
  .btn, .post-action-btn, .nav-link, .category-card {
    min-height: 40px;
  }
  button { touch-action: manipulation; }
}
