.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 80px;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.admin-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.admin-hero p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.add-button {
  min-width: 144px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 10px 28px rgba(99, 102, 241, .24);
  font-weight: 750;
  cursor: pointer;
}

.add-button span { margin-right: 5px; font-size: 18px; }

.publish-panel {
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.publish-fields {
  display: grid;
  grid-template-columns: 1fr 130px 1.5fr;
  gap: 12px;
}

.publish-panel label,
.site-dialog label {
  display: grid;
  gap: 7px;
}

.publish-panel label > span,
.site-dialog label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.publish-panel input,
.site-dialog input,
.site-dialog select,
.site-dialog textarea,
.admin-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font: inherit;
  transition: border-color .2s, box-shadow .2s;
}

.publish-panel input { padding: 10px 12px; }

.publish-panel input:focus,
.site-dialog input:focus,
.site-dialog select:focus,
.site-dialog textarea:focus,
.admin-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.publish-panel p {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.admin-search {
  display: flex;
  align-items: center;
  width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.admin-search span {
  padding-left: 12px;
  color: var(--muted);
  font-size: 22px;
}

.admin-search input {
  padding: 10px 12px;
  border: 0;
  background: transparent;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions button,
.admin-card-actions button,
.site-dialog footer button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

.change-state {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
}

.change-state.dirty { color: #d97706; font-weight: 750; }

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

.admin-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}

.admin-card-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--site-accent);
  background: color-mix(in srgb, var(--site-accent) 12%, transparent);
  font-size: 19px;
  font-weight: 850;
}

.admin-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.admin-card h2 { margin: 0; font-size: 15px; }

.admin-card-title span,
.admin-card small {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--site-accent);
  background: color-mix(in srgb, var(--site-accent) 10%, transparent);
  font-size: 10px;
  font-weight: 750;
}

.admin-card a {
  display: inline-block;
  margin: 3px 0 5px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.admin-card p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-card-actions { display: flex; gap: 7px; }
.admin-card-actions .danger { color: #dc2626; }
.admin-empty { padding: 70px 20px; color: var(--muted); text-align: center; }

.site-dialog {
  width: min(720px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.site-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(5px);
}

.site-dialog form { padding: 24px; }

.site-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.site-dialog h2 { margin: 0; font-size: 23px; }

.dialog-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.site-dialog input,
.site-dialog select,
.site-dialog textarea { padding: 11px 12px; }
.site-dialog textarea { resize: vertical; line-height: 1.6; }
.full-field { grid-column: 1 / -1; }
.full-field > span { display: flex; justify-content: space-between; }
.site-dialog label > small { color: var(--muted); line-height: 1.5; }

.color-field {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
}

.color-field input[type="color"] { height: 43px; padding: 4px; cursor: pointer; }

.site-dialog footer {
  display: flex;
  justify-content: end;
  gap: 10px;
  padding-top: 22px;
}

.site-dialog footer .primary-action { border-color: transparent; color: #fff; }

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 30;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 17px;
  border-radius: 11px;
  color: #fff;
  background: #0f766e;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: .25s ease;
}

.admin-toast.show { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.error { background: #b91c1c; }

@media (max-width: 760px) {
  .admin-shell { width: min(100% - 24px, 1180px); padding-top: 42px; }
  .admin-hero { align-items: stretch; flex-direction: column; }
  .publish-fields { grid-template-columns: 1fr 1fr; }
  .token-field { grid-column: 1 / -1; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { flex-wrap: wrap; }
  .change-state { width: 100%; }
  .admin-card { grid-template-columns: 42px 1fr; }
  .admin-card-actions { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
}

@media (max-width: 480px) {
  .publish-fields { grid-template-columns: 1fr; }
  .token-field { grid-column: auto; }
  .admin-card-mark { align-self: start; }
  .admin-card-title { align-items: start; flex-direction: column; }
  .site-dialog form { padding: 19px; }
}
