.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.12), transparent 30rem),
    radial-gradient(circle at 82% 6%, rgba(245, 158, 11, 0.1), transparent 28rem),
    linear-gradient(180deg, #060a18 0%, #09101f 48%, #050814 100%);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(6, 10, 24, 0.84);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.admin-header .brand {
  min-width: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.admin-sidebar {
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.7), rgba(6, 10, 24, 0.22)),
    rgba(6, 10, 24, 0.34);
  padding: 22px 16px;
}

.admin-sidebar .eyebrow {
  margin: 0 8px 14px;
}

.admin-tab {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.admin-tab.active,
.admin-tab:hover {
  border-color: rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.08);
  color: var(--text);
}

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

.admin-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-title-row h1 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.admin-title-row p:last-child {
  margin: 0;
  color: var(--muted);
}

.admin-title-row input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-title-row input {
  min-height: 46px;
  padding: 0 14px;
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.admin-title-row input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(34, 211, 238, 0.58);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.items-panel,
.editor-panel {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(9, 16, 31, 0.78)),
    rgba(6, 10, 24, 0.64);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

.items-panel {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 12px;
}

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

.item-row {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  padding: 13px;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.item-row.active,
.item-row:hover {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(34, 211, 238, 0.07));
  transform: translateY(-1px);
}

.item-row strong {
  font-size: 15px;
}

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

.editor-panel {
  padding: 18px;
}

#formFields {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  accent-color: #22d3ee;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  cursor: pointer;
  font-weight: 800;
  padding: 0 15px;
}

.danger-button:hover {
  border-color: rgba(248, 113, 113, 0.7);
  background: rgba(127, 29, 29, 0.32);
}

.save-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: #86efac;
  font-weight: 700;
}

.save-status.is-error {
  color: #fecaca;
}

@media (max-width: 980px) {
  .admin-shell,
  .admin-title-row,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    padding: 14px 16px;
  }

  .admin-sidebar .eyebrow {
    display: none;
  }

  .admin-tab {
    width: auto;
    white-space: nowrap;
  }

  .items-panel {
    max-height: none;
  }
}

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

  .admin-header .header-actions {
    width: 100%;
  }

  .admin-header .header-actions a,
  .admin-header .header-actions button {
    flex: 1;
  }
}
