:root {
  --bg-main: #061521;
  --bg-card: #0f2538;
  --bg-soft: #18344e;
  --line: rgba(255, 255, 255, 0.18);
  --line-strong: rgba(255, 255, 255, 0.3);
  --txt-main: #f3f8ff;
  --txt-soft: #b8c8dd;
  --mint: #93f3cf;
  --sun: #ffc26e;
  --danger: #ff6f7f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--txt-main);
  background: radial-gradient(circle at top right, #345778, transparent 35%),
    radial-gradient(circle at left bottom, #3c2f20, transparent 30%),
    linear-gradient(130deg, #04111c, #0b1f31);
  min-height: 100vh;
}

body.admin-locked .admin-shell {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.login-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(1, 8, 14, 0.72);
  backdrop-filter: blur(3px);
}

.login-panel.visible {
  display: grid;
}

.login-card {
  width: min(420px, 90vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(9, 27, 43, 0.98), rgba(11, 32, 49, 0.96));
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.45);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

h1,
h2,
h3 {
  font-family: "Archivo Black", sans-serif;
  margin: 0;
}

.admin-shell {
  width: min(1220px, 94vw);
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.top-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.eyebrow {
  color: var(--mint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
}

.left-panel,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(9, 27, 43, 0.95), rgba(11, 32, 49, 0.9));
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.35);
}

.left-panel {
  padding: 0.9rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.post-list-item button {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  color: var(--txt-main);
  padding: 0.72rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post-list-item button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.post-list-item.active button {
  border-color: var(--mint);
  background: rgba(147, 243, 207, 0.08);
}

.post-list-item strong,
.post-list-item span,
.post-list-item small {
  display: block;
}

.post-list-item span,
.post-list-item small,
.post-list-empty {
  color: var(--txt-soft);
}

.post-list-item span {
  font-size: 0.84rem;
  margin-top: 0.28rem;
}

.post-list-item small {
  margin-top: 0.3rem;
  font-size: 0.82rem;
}

.post-list-empty {
  padding: 0.7rem;
}

.editor-panel {
  padding: 0.95rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

label,
.label-like {
  display: grid;
  gap: 0.32rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.full-width {
  grid-column: 1 / -1;
}

.upload-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--txt-main);
  font: inherit;
  padding: 0.58rem 0.65rem;
}

.rich-editor-wrap {
  margin-top: 0.9rem;
}

#editor {
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  min-height: 280px;
  background: rgba(4, 13, 22, 0.45);
}

.ql-toolbar.ql-snow {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: rgba(255, 255, 255, 0.08);
}

.ql-snow .ql-stroke {
  stroke: #dbe8f8;
}

.ql-snow .ql-fill {
  fill: #dbe8f8;
}

.ql-editor {
  color: var(--txt-main);
}

.actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: end;
  gap: 0.55rem;
}

.status {
  min-height: 1.2rem;
  color: var(--mint);
  font-weight: 700;
}

.status.error {
  color: #ffbcc4;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  color: #1d1810;
  background: linear-gradient(120deg, var(--sun), #ffe7b8);
}

.btn-ghost {
  color: var(--txt-main);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(120deg, #ff7182, #ff9cab);
}

@media (max-width: 980px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .post-list {
    max-height: 260px;
  }
}

@media (max-width: 650px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: start;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .upload-inline {
    grid-template-columns: 1fr;
  }
}
