:root {
  --ink: #142124;
  --muted: #627174;
  --paper: #f5faf8;
  --panel: #ffffff;
  --line: #dce7e3;
  --teal: #0f8a7f;
  --gold: #bd8a33;
  --night: #11191b;
  --radius: 10px;
  --shadow: 0 22px 60px rgb(20 34 36 / 12%);
  --font-body: "Manrope", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Manrope", system-ui, sans-serif;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgb(15 138 127 / 4%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(15 138 127 / 4%) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 270px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--night);
  color: #fff;
  padding: 24px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.admin-brand span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal), var(--gold));
  font-weight: 850;
}

.admin-brand strong,
.admin-title h1,
.stat-card strong {
  font-family: var(--font-display);
}

.admin-sidebar nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar nav a,
.admin-logout {
  border-radius: var(--radius);
  color: rgb(255 255 255 / 76%);
  font-weight: 750;
  padding: 11px 12px;
  text-decoration: none;
}

.admin-sidebar nav a:hover,
.admin-logout:hover {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

.admin-logout {
  margin-top: auto;
}

.admin-main {
  margin-left: 270px;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(245 250 248 / 86%);
  padding: 16px 28px;
  backdrop-filter: blur(14px);
}

.admin-topbar p,
.admin-title p {
  margin: 0;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-topbar a,
.btn-primary {
  border: 0;
  border-radius: var(--radius);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.admin-content {
  padding: clamp(18px, 3vw, 32px);
}

.admin-title {
  margin-bottom: 24px;
}

.admin-title h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin: -2px -2px 22px;
  padding: 0 0 18px;
}

.admin-list-head p {
  max-width: 720px;
}

.admin-list-head .btn-primary,
.admin-list-head .btn-soft {
  flex: 0 0 auto;
}

.admin-editor-panel {
  overflow: visible;
  padding: clamp(18px, 3vw, 28px);
}

.editor-side {
  position: sticky;
  top: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--paper), #fff 56%);
  padding: 18px;
}

.editor-side .form-control,
.editor-side .form-select {
  background: #fff;
}

.stat-card span {
  color: var(--muted);
}

.form-label {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.form-control,
.form-select {
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 0.2rem rgb(15 138 127 / 15%);
}

.table {
  vertical-align: middle;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.btn-soft {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  padding: 9px 12px;
  text-decoration: none;
}

.btn-soft.is-active {
  border-color: color-mix(in oklab, var(--teal), white 45%);
  background: color-mix(in oklab, var(--teal), white 90%);
  color: var(--teal);
}

.btn-danger-soft {
  border: 1px solid #ffd1cc;
  border-radius: var(--radius);
  background: #fff3f1;
  color: #a83224;
  font-weight: 800;
  padding: 9px 12px;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.comment-admin-list {
  display: grid;
  gap: 14px;
}

.comment-admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
}

.comment-admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.comment-admin-top strong,
.comment-admin-top span {
  display: block;
}

.comment-admin-top strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.comment-admin-top span,
.comment-admin-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.comment-admin-card p {
  margin-bottom: 14px;
  color: var(--ink);
  line-height: 1.7;
  white-space: normal;
}

.comment-admin-meta {
  margin-bottom: 14px;
}

.comment-admin-meta a {
  color: var(--teal);
  font-weight: 850;
}

.status-pill {
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  padding: 7px 10px;
  text-transform: uppercase;
}

.status-pill.is-visible {
  background: color-mix(in oklab, var(--teal), white 88%);
  color: var(--teal);
}

.status-pill.is-hidden {
  background: #fff3f1;
  color: #a83224;
}

.featured-check {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
  padding: 10px 12px;
}

.featured-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-image-grid figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.admin-image-grid figcaption {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.admin-image-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-image-grid a {
  color: #a83224;
  font-weight: 850;
  text-decoration: none;
}

.visibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-profile-preview {
  width: 150px;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper);
  padding: 10px;
}

.rich-toolbar button,
.rich-toolbar select {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  min-height: 36px;
  padding: 6px 9px;
}

.rich-toolbar button {
  flex: 0 0 auto;
}

.rich-toolbar select {
  max-width: 180px;
}

.rich-toolbar button:hover,
.rich-toolbar select:hover {
  border-color: color-mix(in oklab, var(--teal), white 48%);
}

.rich-toolbar button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.rich-editor {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fff;
  color: var(--ink);
  line-height: 1.75;
  outline: 0;
  overflow-y: auto;
  padding: 16px;
  word-break: break-word;
}

.rich-editor-large {
  min-height: clamp(420px, 54vh, 620px);
}

.rich-editor:focus {
  box-shadow: 0 0 0 0.2rem rgb(15 138 127 / 15%);
}

.rich-editor h2,
.rich-editor h3,
.rich-editor blockquote {
  font-family: var(--font-display);
}

.rich-editor a {
  color: var(--teal);
  font-weight: 850;
}

.rich-editor figure {
  margin: 18px 0;
}

.rich-editor img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.rich-editor figcaption {
  min-height: 26px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rich-editor blockquote {
  border-left: 4px solid var(--gold);
  margin: 16px 0;
  padding: 12px 16px;
}

.rich-editor * {
  background-color: transparent !important;
  background-image: none !important;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
}

@media (max-width: 900px) {
  .admin-sidebar {
    position: static;
    width: 100%;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-main {
    margin-left: 0;
  }

  .visibility-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-list-head .btn-primary,
  .admin-list-head .btn-soft {
    width: 100%;
    text-align: center;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions .btn-soft {
    flex: 1 1 100%;
  }

  .comment-admin-top {
    flex-direction: column;
  }

  .editor-side {
    position: static;
  }

  .rich-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rich-toolbar button,
  .rich-toolbar select {
    width: 100%;
    max-width: none;
    min-width: 0;
    font-size: 0.84rem;
    padding-inline: 7px;
  }

  .rich-toolbar select {
    grid-column: span 3;
  }

  .rich-editor-large {
    min-height: 420px;
  }
}

@media (max-width: 520px) {
  .admin-sidebar {
    padding: 18px;
  }

  .admin-sidebar nav {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
  }

  .admin-topbar a {
    width: 100%;
    text-align: center;
  }

  .panel,
  .stat-card,
  .admin-editor-panel {
    padding: 16px;
  }

  .admin-title h1 {
    font-size: 2rem;
  }

  .rich-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rich-toolbar select {
    grid-column: span 2;
  }
}
