.admin-body {
  min-height: 100vh;
  background: #eef4f0;
}

.admin-shell {
  min-height: 100vh;
}

.admin-login {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12vh 0 40px;
}

.admin-login form,
.admin-editor,
.admin-sidebar,
.admin-stats {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(13, 34, 29, .08);
}

.admin-login form {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.admin-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--deep);
  font-weight: 900;
}

.admin-logo img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.admin-login h1 {
  margin: 24px 0 8px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
}

.admin-login p {
  color: var(--muted);
}

.admin-message {
  min-height: 24px;
  font-weight: 800;
  color: var(--green);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 14px 24px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(14px);
}

.admin-topbar-actions,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-layout {
  width: min(1360px, calc(100% - 32px));
  margin: 24px auto 60px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
}

.admin-stats {
  width: min(1360px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 22px;
}

.admin-sidebar,
.admin-editor {
  padding: 22px;
}

.admin-sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-head.compact {
  margin-bottom: 10px;
}

.admin-panel-head h1,
.admin-panel-head h2 {
  margin: 0;
  line-height: 1.2;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.admin-post-list {
  display: grid;
  gap: 10px;
}

.admin-post-item {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.admin-post-item:hover,
.admin-post-item.is-active {
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(20, 125, 93, .12);
}

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

.admin-post-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.admin-editor form,
.faq-editor,
.admin-image-tools {
  display: grid;
  gap: 16px;
}

.admin-password-card {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.admin-password-card form {
  display: grid;
  gap: 14px;
}

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

.admin-editor label,
.admin-login label,
.upload-box label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

.admin-editor input,
.admin-editor textarea,
.admin-editor select,
.admin-login input {
  width: 100%;
  border: 1px solid #c8d6ce;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.admin-editor textarea {
  resize: vertical;
}

.admin-ai-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid #d7e3dc;
  border-radius: 8px;
  background: var(--soft);
}

.admin-ai-box p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

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

.stats-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.stats-grid span,
.stats-grid strong {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.stats-grid strong {
  margin-top: 6px;
  color: var(--deep);
  font-size: 30px;
  line-height: 1.1;
}

.stats-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.stats-detail-grid h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.stats-list {
  display: grid;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stats-list a,
.stats-list li > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-list li > span:last-child {
  flex: 0 0 auto;
}

.btn-danger {
  border-color: #b42318;
  background: #fff;
  color: #b42318;
}

.btn-danger:hover {
  background: #b42318;
  color: #fff;
}

.upload-box {
  align-self: end;
  padding: 16px;
  border: 1px dashed #afc4b9;
  border-radius: 8px;
  background: var(--soft);
  display: grid;
  gap: 10px;
}

.upload-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.uploaded-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.uploaded-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.uploaded-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
}

.uploaded-image div {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.uploaded-image button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-weight: 800;
  cursor: pointer;
}

.faq-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.faq-row button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.danger {
  color: #9b1c1c;
  border-color: #e2b4b4;
}

@media (max-width: 980px) {
  .admin-layout,
  .admin-grid-2,
  .admin-image-tools,
  .stats-grid,
  .stats-detail-grid,
  .faq-row {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-layout {
    width: min(100% - 20px, 1360px);
    margin-top: 14px;
  }

  .admin-stats {
    width: min(100% - 20px, 1360px);
    margin-top: 14px;
  }

  .admin-sidebar,
  .admin-editor,
  .admin-stats {
    padding: 16px;
  }
}
