.admin-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem 2rem;
  overflow-y: auto;
  background: rgba(31, 35, 40, 0.4);
  backdrop-filter: blur(3px);
}

.admin-panel {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.admin-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.admin-panel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
}

.admin-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.admin-panel-text-btn {
  padding: 0.25rem 0.45rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.admin-panel-text-btn:hover {
  color: var(--color-accent);
}

.admin-panel-close {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.admin-panel-close:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.admin-panel-desc {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.admin-panel-add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.admin-panel-input {
  flex: 1;
  min-width: 140px;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
}

.admin-panel-input.inline {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-panel-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 0;
  border-color: var(--color-accent);
}

.admin-panel-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  white-space: nowrap;
}

.admin-panel-btn.primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.admin-panel-btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-panel-btn.secondary {
  background: var(--color-surface);
}

.admin-panel-btn.danger {
  border-color: rgba(207, 34, 46, 0.45);
  color: var(--color-danger);
}

.admin-panel-btn.small {
  padding: 0.28rem 0.5rem;
  font-size: 0.8rem;
}

.admin-panel-error {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--color-danger);
}

.admin-panel-muted {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.admin-panel-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.admin-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-panel-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(208, 215, 222, 0.6);
}

.admin-panel-row:last-child {
  border-bottom: none;
}

.admin-panel-name {
  flex: 1;
  min-width: 120px;
  font-size: 0.9rem;
  word-break: break-all;
}
