.admin-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #081116;
  background-size: 48px 48px, 48px 48px, auto;
}

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

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(28rem, 100%);
  padding: 1.25rem;
}

.login-card h1 {
  margin: 2.3rem 0 0.7rem;
  font-size: 2.4rem;
}

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

.login-card button {
  width: 100%;
  margin-top: 1rem;
}

#login-status,
#editor-status {
  min-height: 1.5rem;
  color: var(--danger);
}

.cms-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
}

.cms-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-right: 1px solid var(--line);
  padding: 1.25rem;
  background: rgba(5, 11, 15, 0.8);
  backdrop-filter: blur(16px);
}

.cms-tabs {
  display: grid;
  gap: 0.5rem;
}

.cms-tabs button,
.icon-button {
  min-height: 2.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--steel);
  cursor: pointer;
}

.cms-tabs button {
  text-align: left;
  padding: 0.8rem 0.9rem;
  font-weight: 800;
}

.cms-tabs button:hover,
.cms-tabs button.is-active {
  border-color: rgba(40, 214, 196, 0.3);
  background: rgba(40, 214, 196, 0.1);
  color: var(--ink);
}

#logout {
  margin-top: auto;
}

.cms-content {
  padding: 2rem;
}

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

.cms-header h1 {
  margin: 0;
  font-size: 3rem;
}

.cms-tools {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.cms-tools input {
  min-width: 18rem;
}

.admin-shell {
  min-height: 34rem;
  padding: 0.75rem;
}

.record-list {
  display: grid;
  gap: 0.7rem;
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 1rem;
}

.record h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.record p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  color: var(--steel);
  font-size: 0.78rem;
}

.record button {
  min-width: 5.5rem;
}

.empty-state {
  min-height: 16rem;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.editor-dialog {
  width: min(48rem, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 0;
}

.editor-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.editor-dialog form {
  padding: 1rem;
}

.dialog-head,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.dialog-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.icon-button {
  width: 2.8rem;
  border-color: var(--line);
}

.editor-fields {
  display: grid;
  gap: 1rem;
}

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

.dialog-actions {
  grid-template-columns: auto 1fr auto auto;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}

.button.danger {
  background: rgba(218, 30, 40, 0.13);
  border-color: rgba(218, 30, 40, 0.42);
  color: #ffd7d9;
}

@media (max-width: 900px) {
  .cms-view {
    grid-template-columns: 1fr;
  }

  .cms-sidebar {
    position: static;
    height: auto;
  }

  .cms-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cms-header,
  .cms-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .cms-tools input {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .cms-content {
    padding: 1rem;
  }

  .cms-tabs,
  .field-grid,
  .record {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }
}
