:root {
  --bg: #eef4ff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --border: rgba(49, 88, 248, 0.14);
  --text: #12203a;
  --muted: #5b6984;
  --primary: #3158f8;
  --primary-strong: #1736b9;
  --accent: #0da271;
  --danger: #d14343;
  --shadow: 0 24px 60px rgba(18, 32, 58, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Lexend", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(49, 88, 248, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(13, 162, 113, 0.18), transparent 24%),
    linear-gradient(180deg, #f6f9ff 0%, #edf3ff 100%);
}

.admin-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.admin-auth__panel {
  width: min(100%, 520px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-kicker--dark {
  color: rgba(18, 32, 58, 0.52);
}

.admin-auth__title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
}

.admin-auth__subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-form__submit {
  justify-self: start;
}

.auth-message {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-message[data-state="error"] {
  color: #a12828;
}

.auth-message[data-state="success"] {
  color: #0a6a4d;
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: linear-gradient(180deg, #0f1d3b 0%, #182d5f 100%);
  color: #f4f7ff;
}

.admin-kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 247, 255, 0.62);
}

.admin-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.admin-subtitle {
  margin: 14px 0 0;
  color: rgba(244, 247, 255, 0.78);
  line-height: 1.6;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.admin-nav__button {
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.admin-nav__button:hover,
.admin-nav__button.is-active {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
}

.admin-sidebar__note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 247, 255, 0.82);
  line-height: 1.55;
}

.admin-main {
  padding: 28px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.admin-header__actions,
.button-row,
.button-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-stack {
  flex-direction: column;
  align-items: flex-start;
}

.admin-session {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 190px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-session__label {
  color: var(--muted);
  font-size: 0.8rem;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.button--ghost {
  color: var(--text);
  background: #dfe9ff;
}

.button--danger {
  color: #fff;
  background: linear-gradient(135deg, #ea6767 0%, var(--danger) 100%);
}

.button--file {
  display: inline-flex;
  align-items: center;
}

.flash-message {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(13, 162, 113, 0.12);
  color: #0a6a4d;
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

.stats-grid,
.panel-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-grid--messages {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.stat-card,
.panel-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stat-card {
  padding: 22px;
}

.stat-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-card__value {
  display: block;
  margin-top: 14px;
  font-size: 2rem;
}

.stat-card__value--small {
  font-size: 1rem;
  line-height: 1.45;
}

.panel-card {
  padding: 22px;
}

.panel-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.info-list dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.info-list dd {
  margin: 0;
  font-weight: 600;
}

.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.message-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.message-item,
.post-item {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  background: var(--surface-strong);
  cursor: pointer;
}

.message-item.is-active,
.post-item.is-active {
  border-color: rgba(49, 88, 248, 0.45);
  box-shadow: 0 0 0 3px rgba(49, 88, 248, 0.12);
}

.user-item {
  text-align: left;
}

.user-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.user-item__title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.user-item__excerpt {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(49, 88, 248, 0.1);
}

.status-pill--success {
  background: rgba(13, 162, 113, 0.14);
  color: #0a6a4d;
}

.status-pill--muted {
  background: rgba(91, 105, 132, 0.12);
  color: var(--muted);
}

.message-item__meta,
.post-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.message-item__title,
.post-item__title {
  margin: 0 0 6px;
  font-size: 1rem;
}

.message-item__excerpt,
.post-item__excerpt,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.message-detail {
  display: grid;
  gap: 14px;
}

.message-detail__row {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(18, 32, 58, 0.08);
}

.message-detail__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.input,
.textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(18, 32, 58, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.textarea {
  resize: vertical;
}

.textarea--code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid--content {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
}

.form-grid__full {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.blog-image-tools {
  display: grid;
  gap: 12px;
}

.blog-image-preview {
  border: 1px solid rgba(18, 32, 58, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.blog-image-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 18px;
}

.input-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.admin-account-grid {
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    gap: 18px;
  }

  .stats-grid,
  .panel-grid--two,
  .panel-grid--messages,
  .form-grid,
  .form-grid--content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-auth {
    padding: 18px;
  }

  .admin-auth__panel,
  .admin-main,
  .admin-sidebar {
    padding: 18px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-session {
    width: 100%;
  }
}