:root {
  --bg: #0b0d12;
  --panel: #12151c;
  --card: #161a23;
  --border: #232838;
  --fg: #e6e8ee;
  --muted: #8b93a7;
  --accent: #4f8cff;
  --accent-fg: #06101f;
  --danger: #ef5a5a;
  --ok: #38c172;
  --radius: 10px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-family);
  line-height: 1.5;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- nav ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,13,18,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1100px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--fg); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 18px; align-items: center; font-size: .92rem; }
.nav-links a { color: var(--muted); }
.nav-links a.active, .nav-links a:hover { color: var(--fg); text-decoration: none; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 20px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 22px 20px; color: var(--muted); font-size: .85rem;
}
.footer-social { display: flex; gap: 14px; }
.footer-social a { color: var(--muted); font-size: 1.1rem; }
.footer-social a:hover { color: var(--accent); text-decoration: none; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  border-radius: var(--radius); padding: 10px 16px; font-size: .92rem; cursor: pointer;
  font-family: var(--font-family);
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-sm { padding: 6px 10px; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---- forms ---- */
input, textarea, select {
  width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--fg);
  border-radius: 8px; padding: 10px 12px; font-size: .95rem; font-family: var(--font-family);
}
textarea { resize: vertical; min-height: 120px; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* ---- cards / grid ---- */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0; max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 24px 0 60px; }
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.post-card .thumb { aspect-ratio: 16/9; background: var(--panel); display: block; overflow: hidden; position: relative; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .thumb img.blurred { filter: blur(16px); transform: scale(1.1); }
.post-card .thumb .lock-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; background: rgba(11,13,18,.25);
}
.post-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card .cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.post-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.post-card p { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.post-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.badge-premium { background: rgba(79,140,255,.15); color: var(--accent); }
.badge-draft { background: rgba(139,147,167,.15); color: var(--muted); }

/* ---- category filter chips ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 0; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.chip.active, .chip:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }

/* ---- article ---- */
.article { padding: 40px 0 80px; max-width: 760px; margin: 0 auto; }
.article .cat { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.article h1 { font-size: 2.1rem; line-height: 1.25; margin: 10px 0 14px; letter-spacing: -.02em; }
.article .meta { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.article .cover { width: 100%; border-radius: var(--radius); margin-bottom: 24px; display: block; }
.article .cover.blurred { filter: blur(22px); transform: scale(1.04); }
.article video { width: 100%; border-radius: var(--radius); margin: 16px 0; background: #000; }
.article .body { font-size: 1.05rem; color: #d7dae2; }
.article .body p { margin: 0 0 1.1em; }
.article .body img { max-width: 100%; border-radius: 8px; }
.article .tags { margin-top: 30px; display: flex; gap: 8px; flex-wrap: wrap; }
.article .tags span { font-size: .8rem; color: var(--muted); background: var(--card); border: 1px solid var(--border); padding: 4px 10px; border-radius: 999px; }

.preview-wrap { position: relative; margin-top: 18px; max-height: 150px; overflow: hidden; border-radius: var(--radius); }
.preview-text { filter: blur(4.5px); color: #c3c8d4; user-select: none; pointer-events: none; margin: 0; font-size: 1.02rem; line-height: 1.7; }
.preview-fade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, var(--bg) 92%); }

.paywall {
  margin-top: 14px; padding: 32px 24px; text-align: center; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.paywall h3 { margin: 0 0 8px; }
.paywall p { color: var(--muted); margin: 0 0 20px; }
.paywall .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- login ---- */
.login-box { max-width: 380px; margin: 90px auto; padding: 0 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.msg { border-radius: 8px; padding: 10px 12px; font-size: .85rem; margin: 12px 0; }
.msg.err { background: rgba(239,90,90,.12); color: var(--danger); }
.msg.ok { background: rgba(56,193,114,.12); color: var(--ok); }
.foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 18px; }

/* ---- admin ---- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 210px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border); padding: 18px 12px; }
.sidebar .brand { display: block; padding: 6px 10px 20px; }
.sidebar nav a {
  display: block; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 2px;
}
.sidebar nav a.active, .sidebar nav a:hover { background: var(--card); color: var(--fg); text-decoration: none; }
.main { flex: 1; padding: 26px 32px; max-width: 1100px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h2 { margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255,255,255,.02); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile .n { font-size: 1.6rem; font-weight: 700; }
.stat-tile .l { color: var(--muted); font-size: .8rem; margin-top: 2px; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 50px; align-items: center; gap: 10px; font-size: .85rem; }
.bar-row .track { background: var(--panel); border-radius: 6px; overflow: hidden; height: 10px; }
.bar-row .fill { background: var(--accent); height: 100%; border-radius: 6px; }
.bar-row .label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; z-index: 50; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 720px; width: 100%; padding: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.upload-box { border: 1px dashed var(--border); border-radius: 8px; padding: 14px; text-align: center; font-size: .85rem; color: var(--muted); }
.thumb-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; margin-top: 10px; display: none; }

.pill { padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.pill-ok { background: rgba(56,193,114,.15); color: var(--ok); }
.pill-warn { background: rgba(239,90,90,.15); color: var(--danger); }
.pill-muted { background: rgba(139,147,167,.15); color: var(--muted); }

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

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; align-items: center; overflow-x: auto; }
  .sidebar .brand { display: none; }
  .sidebar nav { display: flex; }
  .main { padding: 20px; }
}

:root { --font-family: Verdana, Geneva, sans-serif; --accent: #4f8cff; }
