/* ==========================================================================
   Administrator console
   ========================================================================== */

.admin-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin-left: auto;
  height: 19px;
  padding: 0 7px;
  border: 1px solid rgba(255, 201, 74, 0.22);
  border-radius: var(--radius-pill);
  color: #98701b;
  background: rgba(255, 201, 74, 0.12);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.admin-menu-link {
  color: #856624 !important;
  background: rgba(255, 201, 74, 0.08);
}

.admin-menu-link .icon {
  color: #b98523 !important;
}

.admin-page {
  gap: 17px;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 10px;
}

.admin-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-breadcrumb a:hover {
  color: var(--ink);
}

.admin-breadcrumb .icon {
  width: 13px;
  height: 13px;
}

.admin-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  min-height: 301px;
  padding: 37px 43px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: var(--cream);
  background:
    radial-gradient(circle at 84% 4%, rgba(255, 201, 74, 0.25), transparent 27%),
    radial-gradient(circle at 100% 100%, rgba(255, 111, 78, 0.2), transparent 35%),
    linear-gradient(118deg, #132e29 0%, #203c34 47%, #33364f 100%);
  box-shadow: 0 30px 70px rgba(21, 45, 38, 0.2);
  isolation: isolate;
}

.admin-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.38;
  background-image:
    linear-gradient(rgba(255, 248, 232, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 248, 232, 0.06) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(90deg, transparent, #000 44%, transparent 90%);
}

.admin-hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 620px;
}

.admin-hero-copy h1 {
  margin: 13px 0 10px;
  font-size: clamp(34px, 4vw, 51px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.admin-hero-copy h1 span {
  color: var(--sun);
}

.admin-hero-copy > p {
  max-width: 570px;
  color: rgba(255, 248, 232, 0.58);
  font-size: 12.5px;
  line-height: 1.9;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.admin-identity-card {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: end;
  width: min(100%, 342px);
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 201, 74, 0.16), transparent 40%),
    rgba(255, 255, 255, 0.075);
  box-shadow: 0 22px 45px rgba(8, 25, 19, 0.18);
  backdrop-filter: blur(16px);
}

.admin-identity-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -66px;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 201, 74, 0.18);
  border-radius: 50%;
}

.admin-shield-sticker {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 201, 74, 0.22);
  border-radius: 10px;
  color: var(--sun);
  background: rgba(255, 201, 74, 0.1);
}

.admin-shield-sticker .icon {
  width: 16px;
  height: 16px;
}

.admin-identity-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-identity-top .avatar {
  border: 2px solid rgba(255, 248, 232, 0.42);
}

.admin-identity-top > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.admin-identity-top > div > span {
  color: rgba(255, 201, 74, 0.67);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.admin-identity-top strong {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.admin-identity-top small {
  color: rgba(255, 248, 232, 0.4);
  font-size: 8px;
}

.admin-identity-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 248, 232, 0.11);
  color: rgba(255, 248, 232, 0.43);
  font-size: 8px;
}

.admin-identity-meta span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #b5f5d9;
}

.admin-identity-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(118, 224, 185, 0.1);
}

.admin-identity-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: rgba(255, 248, 232, 0.26);
  font-size: 7.5px;
}

.admin-identity-foot .icon {
  width: 11px;
  height: 11px;
}

.admin-hero-watermark {
  position: absolute;
  right: 28px;
  bottom: -88px;
  z-index: 0;
  color: rgba(255, 248, 232, 0.045);
  font-family: var(--font-display);
  font-size: 280px;
  line-height: 0.8;
  pointer-events: none;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat-card {
  --stat-color: var(--coral);
  position: relative;
  display: flex;
  min-height: 142px;
  flex-direction: column;
  padding: 15px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--stat-color) 16%, transparent);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--stat-color) 17%, transparent), transparent 57%),
    color-mix(in srgb, var(--stat-color) 5%, #fffdf8);
  animation: admin-card-in 380ms var(--delay) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes admin-card-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-stat-card--coral { --stat-color: #f0745b; }
.admin-stat-card--amber { --stat-color: #d9a129; }
.admin-stat-card--sky { --stat-color: #3b9bd9; }
.admin-stat-card--pink { --stat-color: #e55e95; }
.admin-stat-card--mint { --stat-color: #2b9e82; }
.admin-stat-card--violet { --stat-color: #8a70ec; }

.admin-stat-icon {
  display: flex;
  width: 29px;
  height: 29px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 9px;
  color: color-mix(in srgb, var(--stat-color) 82%, #1b2b25);
  background: color-mix(in srgb, var(--stat-color) 12%, #fffdf8);
}

.admin-stat-icon .icon {
  width: 15px;
  height: 15px;
}

.admin-stat-label {
  color: var(--muted);
  font-size: 8.5px;
}

.admin-stat-card strong {
  margin-top: 1px;
  color: color-mix(in srgb, var(--stat-color) 65%, #1b2e28);
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.admin-stat-card small {
  margin-top: auto;
  color: var(--muted-light);
  font-size: 7.5px;
  line-height: 1.5;
}

.admin-today-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 253, 248, 0.6);
}

.admin-today-icon {
  display: flex;
  width: 27px;
  height: 27px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--teal);
  background: rgba(28, 155, 131, 0.08);
}

.admin-today-icon .icon {
  width: 14px;
  height: 14px;
}

.admin-today-strip p {
  color: var(--muted);
  font-size: 9.5px;
}

.admin-today-strip strong {
  color: var(--ink-soft);
  font-weight: 750;
}

.admin-today-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--teal);
  font-size: 8px;
  white-space: nowrap;
}

.admin-today-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  align-items: start;
  gap: 17px;
}

.admin-panel {
  overflow: hidden;
  padding: 20px;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-panel-head h2 {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.admin-panel-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.6;
}

.admin-panel-head--compact {
  align-items: center;
  padding-bottom: 12px;
}

.admin-panel-head--compact h2 {
  font-size: 17px;
}

.admin-panel-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
  font-weight: 600;
}

.admin-panel-badge .icon {
  width: 11px;
  height: 11px;
}

.admin-post-list {
  display: flex;
  flex-direction: column;
}

.admin-post-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(24, 44, 39, 0.06);
}

.admin-post-category {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  width: 88px;
  color: color-mix(in srgb, var(--category-color, #4d8dff) 76%, #1a2e29);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.4;
}

.admin-post-main {
  min-width: 0;
  flex: 1;
}

.admin-post-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-post-title:hover {
  color: var(--teal);
}

.admin-post-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 8px;
}

.admin-post-meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--muted-light);
}

.admin-anon-tag {
  padding: 1px 4px;
  border-radius: 4px;
  color: #8063a5;
  background: rgba(152, 121, 246, 0.08);
  font-size: 7px;
}

.admin-post-metrics {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--muted-light);
  font-size: 8px;
}

.admin-post-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.admin-post-metrics .icon {
  width: 11px;
  height: 11px;
}

.admin-row-delete {
  display: inline-flex;
  min-height: 29px;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(215, 80, 58, 0.12);
  border-radius: 8px;
  color: #a95545;
  background: rgba(255, 111, 78, 0.045);
  font-size: 8px;
  font-weight: 600;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.admin-row-delete .icon {
  width: 12px;
  height: 12px;
}

.admin-row-delete:hover {
  color: #933b2c;
  border-color: rgba(215, 80, 58, 0.23);
  background: rgba(255, 111, 78, 0.09);
}

.admin-panel-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 13px;
  color: var(--muted-light);
  font-size: 8px;
}

.admin-panel-foot .icon {
  width: 12px;
  height: 12px;
  color: var(--sun);
}

.admin-aside {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.admin-category-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 13px;
}

.admin-category-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-category-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-category-label strong {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
}

.admin-category-track {
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(24, 44, 39, 0.055);
}

.admin-category-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-color), color-mix(in srgb, var(--bar-color) 60%, #ffd86b));
  transition: width 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  padding-top: 7px;
}

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.admin-user-row + .admin-user-row {
  border-top: 1px solid rgba(24, 44, 39, 0.055);
}

.admin-user-row > a {
  flex: none;
}

.admin-user-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0;
}

.admin-user-copy a {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-copy a:hover {
  color: var(--teal);
}

.admin-user-copy span {
  overflow: hidden;
  color: var(--muted-light);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-count {
  flex: none;
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 7.5px;
}

.admin-guideline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(173, 132, 45, 0.11);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 201, 74, 0.28), transparent 54%),
    linear-gradient(135deg, #fff7db, #ffead8);
}

.admin-guideline-mark {
  display: flex;
  width: 30px;
  height: 30px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--sun);
}

.admin-guideline-mark .icon {
  width: 15px;
  height: 15px;
}

.admin-guideline > div {
  min-width: 0;
}

.admin-guideline strong {
  display: block;
  color: #5f5133;
  font-size: 10px;
}

.admin-guideline p {
  margin-top: 4px;
  color: #8c7954;
  font-size: 8.5px;
  line-height: 1.75;
}

@media (max-width: 1180px) {
  .admin-hero {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 0.75fr);
    padding-inline: 34px;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-stat-card {
    min-height: 125px;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 980px) {
  .admin-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px;
  }

  .admin-identity-card {
    display: none;
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-guideline {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .admin-hero {
    padding: 27px 21px;
    border-radius: 25px;
  }

  .admin-hero-copy h1 {
    font-size: 34px;
  }

  .admin-hero-copy > p {
    font-size: 11px;
  }

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

  .admin-stat-card {
    min-height: 122px;
    padding: 13px;
  }

  .admin-stat-card strong {
    font-size: 27px;
  }

  .admin-today-strip {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 11px 13px;
  }

  .admin-today-strip p {
    flex: 1;
    min-width: 180px;
    font-size: 9px;
  }

  .admin-today-status {
    display: none;
  }

  .admin-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-guideline {
    grid-column: auto;
  }

  .admin-panel {
    padding: 16px 14px;
  }

  .admin-panel-head {
    gap: 10px;
  }

  .admin-panel-head h2 {
    font-size: 19px;
  }

  .admin-panel-head p {
    font-size: 8.5px;
  }

  .admin-post-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 9px;
    padding: 12px 1px;
  }

  .admin-post-category {
    grid-column: 1 / -1;
    width: auto;
    font-size: 8.5px;
  }

  .admin-post-main {
    grid-column: 1;
  }

  .admin-post-title {
    white-space: normal;
    font-size: 11px;
  }

  .admin-post-metrics {
    display: none;
  }

  .admin-row-delete {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    padding: 5px;
  }

  .admin-row-delete span {
    display: none;
  }
}

@media (max-width: 420px) {
  .admin-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-hero-actions .btn {
    width: 100%;
  }

  .admin-stat-card {
    min-height: 112px;
    padding: 11px;
  }

  .admin-stat-card strong {
    font-size: 25px;
  }

  .admin-stat-label {
    font-size: 8px;
  }

  .admin-stat-icon {
    width: 26px;
    height: 26px;
    margin-bottom: 7px;
  }

  .admin-stat-card small {
    font-size: 7px;
  }

  .admin-panel-head--compact h2 {
    font-size: 16px;
  }
}
