/* ══════════════════════════════════════════════
   DevoongLog · main.css
   Futuristic · Dark/Light · Green Accent
══════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --green-100: #f0fdf4;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #134e29;
  --green-900: #0a2e18;
  --green-glow: rgba(34, 197, 94, 0.25);
  --green-glow-sm: rgba(34, 197, 94, 0.12);

  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --font-sans: 'Noto Sans KR', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;

  --sidebar-w: 260px;
  --header-h: 58px;
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
  --bg: #080d0b;
  --bg-2: #0d1510;
  --bg-3: #111a14;
  --bg-4: #162019;
  --bg-glass: rgba(13, 21, 16, 0.82);
  --border: rgba(34, 197, 94, 0.14);
  --border-bright: rgba(34, 197, 94, 0.35);
  --text: #e2f0e8;
  --text-2: #9abda6;
  --text-3: #5d7a68;
  --text-muted: #3d5445;
  --accent: #4ade80;
  --accent-2: #22c55e;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-green: 0 0 20px rgba(34, 197, 94, 0.2);
  --card-bg: rgba(17, 26, 20, 0.9);
  --header-bg: rgba(8, 13, 11, 0.92);
  --modal-bg: #0d1510;
  --input-bg: rgba(13, 21, 16, 0.7);
  --scrollbar-bg: #0d1510;
  --scrollbar-thumb: rgba(34, 197, 94, 0.3);
  --tag-bg: rgba(34, 197, 94, 0.1);
  --tag-border: rgba(34, 197, 94, 0.25);
  --grid-color: rgba(34, 197, 94, 0.04);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg: #f7fcf9;
  --bg-2: #edf7f1;
  --bg-3: #e3f2e9;
  --bg-4: #d4e9db;
  --bg-glass: rgba(240, 253, 244, 0.88);
  --border: rgba(22, 163, 74, 0.18);
  --border-bright: rgba(22, 163, 74, 0.4);
  --text: #0f2218;
  --text-2: #2d5a3f;
  --text-3: #5a8a6e;
  --text-muted: #8ab09a;
  --accent: #16a34a;
  --accent-2: #22c55e;
  --accent-dim: rgba(22, 163, 74, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  --shadow-green: 0 0 20px rgba(22, 163, 74, 0.15);
  --card-bg: rgba(255, 255, 255, 0.9);
  --header-bg: rgba(247, 252, 249, 0.95);
  --modal-bg: #f7fcf9;
  --input-bg: rgba(255, 255, 255, 0.8);
  --scrollbar-bg: #edf7f1;
  --scrollbar-thumb: rgba(22, 163, 74, 0.35);
  --tag-bg: rgba(22, 163, 74, 0.08);
  --tag-border: rgba(22, 163, 74, 0.25);
  --grid-color: rgba(22, 163, 74, 0.05);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

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

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Background Effects ─── */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}

.ambient-glow {
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.06) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
  animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

/* ─── HEADER ─── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-slow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  padding: 0 24px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Logo */
.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-bracket { color: var(--accent); }
.logo-cursor {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.header-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  border-color: var(--border-bright);
  background: var(--accent-dim);
  text-decoration: none;
}

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

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: var(--transition);
}
.btn-icon:hover {
  color: var(--accent);
  border-color: var(--border-bright);
  background: var(--accent-dim);
}
.btn-icon svg { width: 16px; height: 16px; }

/* Theme toggle icons */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.admin-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-bright);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Search Bar */
.search-bar {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.2s ease;
}

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

.search-bar input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.search-bar input:focus { border-color: var(--accent); background: var(--bg-2); }
.search-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
}

/* ─── LAYOUT ─── */
.site-container {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-h);
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin: 0 auto;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 0 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Profile Card */
.profile-card {
  padding: 0 16px 24px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar-wrap {
  position: relative;
  width: 76px; height: 76px;
  margin: 0 auto 14px;
}

.profile-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  z-index: 1;
}

/* Hide fallback if image loads */
.profile-avatar-img:not([src=""]) ~ .avatar-fallback { display: none; }

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box,
              linear-gradient(135deg, var(--accent), var(--green-700)) border-box;
  z-index: 3;
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.profile-body { text-align: center; }

.profile-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.profile-bio {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 12px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
}

.p-tag {
  font-family: var(--font-code);
  font-size: 10px;
  color: var(--accent);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.profile-links { display: flex; justify-content: center; gap: 8px; }

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.profile-link:hover {
  color: var(--accent);
  border-color: var(--border-bright);
  background: var(--accent-dim);
  text-decoration: none;
}
.profile-link svg { width: 16px; height: 16px; }

/* Sidebar Nav */
.sidebar-nav {
  padding: 16px 12px 0;
  flex: 1;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 0 8px 10px;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  font-family: var(--font-sans);
  text-align: left;
  transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border);
}
.nav-item.active {
  background: var(--accent-dim);
  border-color: var(--border-bright);
  color: var(--accent);
}
.nav-ico { font-size: 14px; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-count {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.nav-item.active .nav-count { color: var(--accent); background: var(--accent-dim); }

/* Admin panel in sidebar */
.admin-panel {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.admin-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cat-editor-form {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.cat-editor-form input {
  flex: 1;
  padding: 6px 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  outline: none;
  min-width: 0;
}
.cat-editor-form input:focus { border-color: var(--accent); }

.btn-add-cat {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
}
.btn-add-cat:hover { background: var(--accent-2); }

.cat-edit-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.cat-edit-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.cat-edit-item .cat-name { flex: 1; }
.cat-edit-item .btn-del-cat {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
  transition: var(--transition);
}
.cat-edit-item .btn-del-cat:hover { color: #f87171; }

.sidebar-footer {
  padding: 16px 16px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.terminal-text {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--accent);
  opacity: 0.6;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 32px 64px;
}

/* ─── HERO ─── */
.hero {
  padding: 48px 0 40px;
  text-align: center;
  position: relative;
}

.hero-glitch {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text);
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.hero-glitch::before,
.hero-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: 700;
}
.hero-glitch::before {
  color: var(--accent);
  animation: glitch1 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.hero-glitch::after {
  color: #60a5fa;
  animation: glitch2 4s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
  0%, 85%, 100% { transform: none; opacity: 0; }
  86% { transform: translate(-3px, 0); opacity: 0.6; }
  88% { transform: translate(3px, 0); opacity: 0.4; }
  90% { transform: none; opacity: 0; }
}
@keyframes glitch2 {
  0%, 88%, 100% { transform: none; opacity: 0; }
  89% { transform: translate(3px, 0); opacity: 0.5; }
  91% { transform: translate(-3px, 0); opacity: 0.3; }
  93% { transform: none; opacity: 0; }
}

.hero-sub {
  font-size: 15px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.hero-cursor {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 0 auto;
  max-width: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
}

.stat-box {
  flex: 1;
  padding: 16px;
  text-align: center;
}

.stat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ─── POSTS SECTION ─── */
.posts-section { margin-top: 8px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text-3);
  flex: 1;
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  color: var(--text-3);
  transition: var(--transition);
}
.view-btn:hover { background: var(--bg-3); color: var(--text); }
.view-btn.active { background: var(--accent-dim); color: var(--accent); }
.view-btn svg { width: 14px; height: 14px; }

.btn-new-post {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-new-post:hover { background: var(--accent-2); transform: translateY(-1px); }

/* ─── POST GRID ─── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.posts-grid.view-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Post Card */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease both;
}

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

.post-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
}

.post-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  background: var(--bg-3);
}

.post-card-img-placeholder {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-4) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--text-muted);
}

.post-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

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

.post-cat-label {
  font-family: var(--font-code);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--tag-border);
  padding: 2px 8px;
  border-radius: 20px;
}

.post-date {
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.post-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.post-tag {
  font-family: var(--font-code);
  font-size: 10px;
  color: var(--text-3);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  padding: 2px 7px;
  border-radius: 20px;
}

/* List View Card */
.posts-grid.view-list .post-card {
  flex-direction: row;
  align-items: center;
}
.posts-grid.view-list .post-card-img { width: 140px; height: 90px; flex-shrink: 0; }
.posts-grid.view-list .post-card-img-placeholder { width: 100px; height: 90px; }
.posts-grid.view-list .post-card-body { padding: 14px 16px; }
.posts-grid.view-list .post-card-excerpt { -webkit-line-clamp: 1; }

/* Draft badge */
.post-draft-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
}

/* Admin card controls */
.post-card-admin {
  position: absolute;
  bottom: 8px; right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}
.post-card:hover .post-card-admin { opacity: 1; }
.post-card-admin button {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-2);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.post-card-admin .btn-edit:hover { color: var(--accent); border-color: var(--border-bright); }
.post-card-admin .btn-del:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }

/* Empty state */
.no-posts {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}
.no-posts-icon { font-size: 40px; margin-bottom: 12px; }
.no-posts p { font-size: 14px; }

/* ─── MODALS ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlayIn 0.2s ease;
}

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

.modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow), 0 0 60px var(--green-glow);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.editor-modal {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-3);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text); border-color: var(--border-bright); }

.modal-logo {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
}

/* ─── FORMS ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-3);
  text-transform: uppercase;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); background: var(--bg-2); }
.form-group select option { background: var(--bg-2); }

.form-row {
  display: flex;
  gap: 14px;
}
.form-row .form-group { flex: 1; margin-bottom: 0; }
.flex1 { flex: 1 !important; }

.input-with-btn {
  display: flex;
  gap: 6px;
}
.input-with-btn input { flex: 1; }
.btn-inline {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-inline:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  width: 100%;
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: var(--shadow-green); }

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.login-error {
  color: #f87171;
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

/* ─── EDITOR TOOLBAR ─── */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-top: 14px;
}

.tb-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  border-right: 1px solid var(--border);
}
.tb-group:last-child { border-right: none; }

.tb-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-family: var(--font-code);
  transition: var(--transition);
}
.tb-btn:hover { background: var(--bg-4); border-color: var(--border); color: var(--accent); }
.tb-btn.active { background: var(--accent-dim); border-color: var(--border-bright); color: var(--accent); }

.tb-select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  padding: 4px 8px;
  font-size: 12px;
  height: 30px;
  outline: none;
  cursor: pointer;
}
.tb-select:hover { border-color: var(--accent); }

/* ─── EDITOR AREA ─── */
.editor-area {
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 16px 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  outline: none;
  transition: border-color var(--transition);
  word-break: break-word;
}
.editor-area:focus { border-color: var(--accent); }

/* Editor content styling */
.editor-area p { margin-bottom: 10px; }
.editor-area h2 { font-family: var(--font-mono); font-size: 22px; margin: 20px 0 12px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.editor-area h3 { font-family: var(--font-mono); font-size: 18px; margin: 16px 0 10px; color: var(--text); }
.editor-area h4 { font-size: 16px; font-weight: 700; margin: 12px 0 8px; color: var(--text); }
.editor-area blockquote { border-left: 3px solid var(--accent); padding: 8px 16px; margin: 12px 0; background: var(--accent-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.editor-area pre, .editor-area code { font-family: var(--font-code); font-size: 13px; background: var(--bg-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.editor-area pre { padding: 14px 16px; overflow-x: auto; margin: 12px 0; }
.editor-area code { padding: 2px 6px; }
.editor-area img { max-width: 100%; border-radius: var(--radius); margin: 10px 0; }
.editor-area a { color: var(--accent); }
.editor-area ul, .editor-area ol { padding-left: 24px; margin: 10px 0; }
.editor-area li { margin-bottom: 4px; }
.editor-area hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.editor-area .file-attachment { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 13px; color: var(--text-2); margin: 4px; }

.editor-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 6px;
}

.editor-mode-btns { display: flex; gap: 4px; }
.mode-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  transition: var(--transition);
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--accent-dim); border-color: var(--border-bright); color: var(--accent); }

.word-count { font-family: var(--font-code); font-size: 11px; color: var(--text-muted); }

.raw-html-area {
  width: 100%;
  min-height: 200px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #4ade80;
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
}

.preview-area {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.editor-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  margin-right: auto;
}
.check-label input { accent-color: var(--accent); width: 14px; height: 14px; }

.btn-secondary { width: auto; }
.btn-primary { width: auto; padding: 9px 20px; }

/* ─── TOAST ─── */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--border-bright); }
.toast.success::before { content: '✓'; color: var(--accent); font-weight: 700; }
.toast.error { border-color: rgba(248, 113, 113, 0.3); }
.toast.error::before { content: '✗'; color: #f87171; font-weight: 700; }
.toast.info::before { content: 'ℹ'; color: #60a5fa; font-weight: 700; }
.toast.fade-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── FOOTER ─── */
.site-footer {
  position: relative;
  z-index: 2;
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
}
.site-footer a { color: var(--text-3); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.f-sep { color: var(--text-muted); }

/* ─── UTILITY ─── */
.hidden { display: none !important; }

.admin-only { /* shown by JS when admin */ }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .main-content { padding: 20px 16px 48px; }
}

@media (max-width: 700px) {
  .site-container { flex-direction: column; }
  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
  }
  .profile-card { display: none; }
  .sidebar-footer { display: none; }
  .sidebar-nav { padding: 0; }
  .nav-list { flex-direction: row; flex-wrap: wrap; }
  .header-nav { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .editor-modal { max-height: 95vh; }
  .form-row { flex-direction: column; }
  .editor-toolbar { gap: 4px; }
}
