:root{
  --bg:#050505;
  --panel:#0d0d0d;
  --card:#121212;
  --line:#242424;
  --text:#ffffff;
  --muted:#a6a6a6;

  --red:#b00000;
  --red2:#8b0000;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
}
a{color:inherit;text-decoration:none}

.wrap{max-width:1180px;margin:0 auto;padding:20px 18px 60px}
.pageTitle{margin:8px 0 14px;font-size:28px;font-weight:900}
.h2{margin:0;font-size:18px;font-weight:900}
.muted{color:var(--muted)}
.small{font-size:12px}
.link{text-decoration:underline}

.topbar{
  height:68px;
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;
  padding:0 18px;
  background:#000;
  border-bottom:1px solid #151515;
}
.left{display:flex;align-items:center;gap:14px}
.logo{font-size:20px;font-weight:900}
.nav{display:flex;gap:10px;align-items:center}
.navLink{
  color:#fff;
  opacity:.9;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
}
.navLink:hover{opacity:1;border-color:#222;background:#0b0b0b}

.right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.user{color:var(--muted);font-size:13px}

.searchBar{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  max-width:520px;
}
.searchInput{
  width:100%;
  background:#0b0b0b;
  border:1px solid #333;
  border-radius:14px;
  padding:10px 12px;
  color:#fff;
  outline:none;
}
.searchInput::placeholder{
  color:#ffffff;
  opacity:1;
}
.searchInput::-webkit-input-placeholder{
  color:#ffffff !important;
}

.searchInput::-moz-placeholder{
  color:#ffffff !important;
}

.searchInput:-ms-input-placeholder{
  color:#ffffff !important;
}
.searchInput:focus{border-color: var(--red)}
.searchBtn{padding:10px 16px;border-radius:14px}

.btnPrimary,.btnGhost,.btnDanger{
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  color:#fff;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:900;
  user-select:none;
}
.btnDanger{
  background: var(--red);
  border-color:#500;
}
.btnPrimary{
  background: #1a1a1a;
  border-color:#333;
}
.btnGhost{
  background:#111;
  border-color:#333;
}
.btnGhost.disabled{
  opacity:.35;
  pointer-events:none;
}
.wide{width:100%}

.panel{
  background: var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}

.panelHeader{
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:12px;
}

.rowTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.rowActions{display:flex;gap:10px;flex-wrap:wrap}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
}
.card:hover{border-color:#333}
.lockedCard{opacity:.92}
.lockBadge{display:inline-flex;margin-left:8px;font-size:14px;opacity:.9}
.cardTitle{font-weight:900;font-size:18px}
.cardSub{color:var(--muted);font-size:13px;margin-top:6px}

.grid2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (max-width:860px){.grid2{grid-template-columns:1fr}}

.grid3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:14px;
}
@media (max-width:1100px){.grid3{grid-template-columns: repeat(2, minmax(0,1fr));}}
@media (max-width:760px){.grid3{grid-template-columns: 1fr;}}

.postCard{
  background:#0a0a0a;
  border:1px solid #1f1f1f;
  border-radius:16px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.mediaBtn{
  position:relative;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
}
.mediaBtn:focus{outline:2px solid rgba(176,0,0,.35);outline-offset:2px}
.lockedBtn{cursor:not-allowed}

.kindBadge{
  position:absolute;
  top:10px;
  left:10px;
  z-index:2;
  font-size:12px;
  font-weight:1000;
  padding:4px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.7);
  border:1px solid rgba(255,255,255,.12);
}

.thumb{
  width:100%;
  border-radius:14px;
  max-height:520px;
  object-fit:cover;
  background:#000;
  display:block;
}
.blurred{filter: blur(10px) brightness(.85); transform: scale(1.02);}
.overlayText{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-weight:1000;
  letter-spacing:.2px;
  color:#fff;
  background: rgba(0,0,0,.25);
  border-radius:14px;
  text-shadow: 0 2px 20px rgba(0,0,0,.8);
}

.meta{display:flex;flex-direction:column;gap:6px}
.desc{white-space:pre-wrap}
.tags{display:flex;gap:6px;flex-wrap:wrap}
.tag{
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  background: rgba(176,0,0,.10);
  border:1px solid rgba(176,0,0,.22);
  color:#fff;
}

.pager{
  display:flex;
  justify-content:space-between;
  margin-top:14px;
  gap:10px;
  flex-wrap:wrap;
}

.flash{margin:0 0 14px}
.flashItem{
  background: rgba(176,0,0,.10);
  border:1px solid rgba(176,0,0,.20);
  padding:10px 12px;
  border-radius:14px;
  color:#fff;
  margin-bottom:8px;
}

.authBox{max-width:460px;margin:0 auto}
.form{display:flex;flex-direction:column;gap:10px}
.formRow{display:flex;gap:10px;flex-wrap:wrap}
.formRow .input{flex:1;min-width:220px}
.label{color:var(--muted);font-size:13px}
.input{
  width:100%;
  background:#0b0b0b;
  border:1px solid #333;
  border-radius:14px;
  padding:12px 12px;
  color:#fff;
  outline:none;
}
.input:focus{border-color: var(--red)}
.code{letter-spacing:.22em;text-transform:uppercase}

.viewer{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.86);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9998;
  padding:18px;
}
.viewer.open{display:flex;}
.viewerInner{
  width:min(980px, 96vw);
  background:#0b0b0b;
  border:1px solid #222;
  border-radius:18px;
  box-shadow: var(--shadow);
  position:relative;
  padding:14px;
}
.viewerBody{display:flex;align-items:center;justify-content:center}
.viewerMedia{
  width:100%;
  max-height:78vh;
  object-fit:contain;
  border-radius:14px;
  background:#000;
}

.adminNav{display:flex;gap:10px;flex-wrap:wrap}
.table{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:12px;
  border:1px solid #222;
  border-radius:14px;
  background:#0b0b0b;
}
.cell{flex:1;min-width:220px}
.bold{font-weight:1000}
.mini{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.codeText{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace}

.uploadBox{display:flex;flex-direction:column;gap:10px}
.fileInput{display:none}

.uploadPreview{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}
.uploadItem{
  border:1px solid #222;
  border-radius:14px;
  background:#0b0b0b;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.uploadTop{display:flex;justify-content:space-between;gap:10px;align-items:center}
.uploadName{font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uploadKind{color:var(--muted);font-size:12px}
.uploadMedia{
  width:100%;
  border-radius:12px;
  max-height:360px;
  object-fit:cover;
  background:#000;
  display:block;
}

/* Главная */
.heroTitle{font-size:26px;font-weight:1000}
.heroGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
@media (max-width:980px){.heroGrid{grid-template-columns: repeat(2, minmax(0,1fr));}}
.heroStat{
  border:1px solid #1f1f1f;
  background:#0b0b0b;
  border-radius:14px;
  padding:12px;
}
.heroNum{font-size:16px;font-weight:1000;margin-top:6px}
.heroActions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
